Part Number Hot Search : 
EPM570 300BZX LM555CM D2001 FQP9N90C CM800 TDA4821P M100S
Product Description
Full Text Search
 

To Download TMP1942XBG Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 32bit TX System RISC TX19 family TMP1942CYUE TMP1942CZUE/XBG
Rev1.0
March 29, 2007
TX1942CY/CZ
32-Bit RISC Microprocessor TX19 Family TMP1942CYUE/CZUE/CZXBG
1.
Outline and Features
The TX19 is a family of high-performance 32-bit microprocessors that offers the speed of a 32-bit RISC solution with the added advantage of a significantly reduce code size of a 16-bit architecture. The instruction set of the TX19 includes as a subset the 32-bit instructions of the TX39, which is based on the MIPS R3000ATM architecture. Additionally, the TX19 supports the MIPS16TM Application-Specific Extensions (ASE) for improved code density. The TMP1942 is built on a TX19 core processor and a selection of intelligent peripherals. The TMP1942 is suitable for low-voltage, low-power applications. Features of the TMP1942 include the following:
RESTRICTIONS ON PRODUCT USE
070122EBP
* The information contained herein is subject to change without notice. 021023_D * TOSHIBA is continually working to improve the quality and reliability of its products. Nevertheless, semiconductor devices in general can malfunction or fail due to their inherent electrical sensitivity and vulnerability to physical stress. It is the responsibility of the buyer, when utilizing TOSHIBA products, to comply with the standards of safety in making a safe design for the entire system, and to avoid situations in which a malfunction or failure of such TOSHIBA products could cause loss of human life, bodily injury or damage to property. In developing your designs, please ensure that TOSHIBA products are used within specified operating ranges as set forth in the most recent TOSHIBA products specifications. Also, please keep in mind the precautions and conditions set forth in the "Handling Guide for Semiconductor Devices," or "TOSHIBA Semiconductor Reliability Handbook" etc.
021023_A
* The TOSHIBA products listed in this document are intended for usage in general electronics applications (computer, personal equipment, office equipment, measuring equipment, industrial robotics, domestic appliances, etc.). These TOSHIBA products are neither intended nor warranted for usage in equipment that requires extraordinarily high quality and/or reliability or a malfunction or failure of which may cause loss of human life or bodily injury ("Unintended Usage"). Unintended Usage include atomic energy control instruments, airplane or spaceship instruments, transportation instruments, traffic signal instruments, combustion control instruments, medical instruments, all types of safety devices, etc. Unintended Usage of TOSHIBA products listed in this document shall be made at the customer's own risk. 021023_B * The products described in this document shall not be used or embedded to any downstream products of which manufacture, use and/or sale are prohibited under any applicable laws and regulations. 060106_Q * The information contained herein is presented only as a guide for the applications of our products. No responsibility is assumed by TOSHIBA for any infringements of patents or other rights of the third parties which may result from its use. No license is granted by implication or otherwise under any patents or other rights of TOSHIBA or the third parties.
070122_C
* The products described in this document are subject to foreign exchange and foreign trade control laws. 060925_E * For a discussion of how the reliability of microcontrollers can be predicted, please refer to Section 1.3 of the chapter entitled Quality and Reliability Assurance/Handling Precautions. 030619_S
TMP1942CY/CZ-1
TX1942CY/CZ
(1) TX19 core processor 1) Two instruction set architecture (ISA) modes: 16-bit ISA for code density and 32-bit ISA for speed * * 2) The 16-bit ISA is object-code compatible with the code-efficient MIPS16TM ASE. The 32-bit ISA is object-code compatible with the high-performance TX39 family.
Combines high performance with low power consumption. - High performance * * * * * Single clock cycle execution for most instructions 3-operand computational instructions for high instruction throughput 5-stage pipeline On-chip high-speed memory DSP function: Executes 32-bit x 32-bit multiplier operations with a 64-bit accumulation in a single clock cycle. Optimized design using a low-power cell library Programmable standby modes in which processor clocks are stopped Distinct starting locations for each interrupt service routine Automatically generated vectors for each interrupt source Automatic updates of the interrupt mask level
- Low power consumption * * 3) * * *
Fast interrupt response suitable for real-time control
(2) Internal RAM: FDUE/FDXBG: 20KB,CYUE/CZUE/CZXBG: 16 KB Internal ROM: FDUE/FDXBG: 512KB,CYUE/CZXBG: 384KB,CYUE: 256 KB ROM correction function (8 words x 4 blocks) (For FDUE/FDXBG, only registers are available; data is not replaced.) (3) External memory expansion * * * 16-Mbyte off-chip address space for code and data External bus interface with dynamic bus sizing for 8-bit and 16-bit data ports
(4) 4-channel DMA controller Interrupt- or software-triggered
(5) 6 channel 8-bit PWM timer (12 channel 8-bit interval timer, 6 channel 16-bit interval timer, 6 channel 8-bit PPG output) (6) 14 channel 16-bit timer (2 channels support 2-phase input pulse counter mode.) (7) 1 channel real-time counter (RTC) (8) 5 channel general-purpose serial interface (Supports both UART and synchronous transfer modes) (9) 1 channel serial bus interface Either I2C bus mode or clock-synchronous mode can be selected. (10) 16 channel 10-bit A/D converter (with internal sample/hold) Conversion time: 2 s (throughput), 4 to 5 s (latency) (11) 3 channel 10-bit D/A converter (12) Watchdog timer (13) 4 channel chip select/wait controller
TMP1942CY/CZ-2
TX1942CY/CZ
(14) Interrupt sources * * * 4 CPU interrupts: software interrupt instruction 45 internal interrupts: 7 priority levels, with the exception of the watchdog timer interrupt 29 external interrupts: 7 priority levels, with the exception of the NMI interrupt The external sources include 14 KWUP sources, which are all assigned to a single interrupt vector, and 4 extended interrupts (INTB, INTC, INTD, and INTE), which are all assigned to a single interrupt vector with an identification flag. Thus, the actual number of external interrupt sources is 13.
(15) 108 pin input/output ports (16) Three standby function * * * * IDLE, SLEEP, and STOP
(17) Dual clocks RTC clock: Low-speed clock (32.768 kHz)
(18) Clock generator On-chip PLL (x4) Clock gear: Divides the operating speed of the CPU by 1/2, 1/4 or 1/8
(19) Operating voltage range: 2.7 to 3.6 V PC and PF are 2.7 to 3.6 V or 4.5 to 5.25 V for 5 V-enabled ports. (20) Operating frequency * * * * 32 MHz (Vcc 3.0 V) 28 MHz (Vcc 2.7 V)
(21) Package 144-pin QFP (16 x 16 x 1.4 (t) mm, 0.4-mm pitch): FDUE/CZUE/CYUE 177-pin CSP (13 x 13 x 1.4 (t) mm, 0.8-mm pitch): FDXBG/CZXBG
Note: TMP1942FDXBG (Package: 177-pin CSP) is under development.
TMP1942CY/CZ-3
TX1942CY/CZ
TX19 Proccessor Core TX19 CPU
(*) MROM for the mask ROM version. CZUE/XBG:384KB
MAC
DSU
256 KBROM (*)
16 KBRAM
ROM correction
DMAC (4ch)
NMI INT0 (PF6) INT12 (PE67) INT34 (PA01) INT56 (PA34) INT7 (PB7) INT8A (PC02) AN07 (P5057) AN815 (P6067) ADTRG (P57) AVCC/AVSS VREFH/VREFL
CG G-Bus
X1 X2 XT1 (PD6) XT2 (PD7) SCOUT (P44) PLLOFF*
INTC
EBIF
RESET*
I/O Bus I/F 10-bit ADC (16ch)
BW0/1 INTLV (PE7)
DAOUT03 DAVCC/DAVSS DAREFH
10-bit DAC (3ch)
PORT0
AD07 (P00P07)
TXD0 (PD0) RXD0 (PD1) SCLK0/CTS0 (PD2)
PORT1 SIO0 PORT2
AD8/A8AD15/A15 (P10P17)
A0/A16A7/A23 (P20P27)
TXD1 (PD3) RXD1 (PD4) SCLK1/CTS1 (PD5) RD (P30) TXD3 (PE0) RXD3 (PE1) SCLK3/CTS3 (PE2) SCK (PF3) SO/SDA (PF4) SI/SCL (PF5) TXD4 (PE3) RXD4 (PE4) SCLK4/CTS4 (PE5) TXD5 (PF0) RXD5 (PF1) SCLK5/CTS5 (PF2) TB4IN1 (PB5), TB0IN01 (PA01) TB7IN01 (P9596), TB1IN01 (PA34) TB8IN01 (PC67), TB2IN01 (PB01) TB9IN01 (PD01), TB3IN01 (PB34) TBAIN01 (PD56), TB4IN0 (PB2) TB0OUT (PA2), TB1OUT (PA5), TB2OUT (PB2), TB3OUT (PB5), TB4OUT (P92) TB5OUT (P93) TB6OUT (P94) TB7OUT (P97) WR (P31)
SIO1
SIO3 PORT3 SERIAL BUS I/F
HWR (P32) WAIT (P33) BUSRD (P34) BUSAK* (P35) R/W (P36) P37
SIO4 PORT4 SIO5 WDT
CS0CS3 (P40P43)
16-bit TMR0-D (14ch)
Real-Time Counter (RTC)
INTBC (PB01)
INTBCDE 8-bit TMR0/1 A/B (12ch)
INTDE (PB34)
TA1OUT (PA6), TA7OUT (PC5) TA3OUT (PB6), TA9OUT (PC7) TA5OUT (PC3), TABOUT (PD5) TA0IN (PA7), TA2IN (PB7), TA4IN (PC0), TA6IN (PC1) TA8IN (PC2) TAAIN (PC4)
KWUP JTAG
Figure 1.1 TMP1942 Block Diagram
TMP1942CY/CZ-4
TX1942CY/CZ
2.
Signal Descriptions
This section contains pin assignments for the TMP1942 as well as brief descriptions of the functions of the TMP1942 input and output pins.
2.1
Pin Assignment
Table 2.1.1 shows TMP1942 pin assignment.
144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73
Figure 2.1.1 144-Pin LQFP Pin Assignment
TMP1942CY/CZ-5
TX1942CY/CZ
Table 2.1.1 Pin Assignment (144-pin LQFP) Pin No.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
Pin Name
VREFH VREFL P50/AN0 P51/AN1 P52/AN2 P53/AN3 DAVCC DAVSS DAREH DAOUT0 DAOUT1 DAOUT2 P54/AN4 P55/AN5 P56/AN6 P57/AN7/ADTRG P60/AN8/KEY0 DVSS P61/AN9/KEY1 P62/AN10/KEY2 P63/AN11/KEY3 P64/AN12/KEY4 P65/AN13/KEY5 P66/AN14/KEY6 P67/AN15/KEY7 DVCC3 P00/AD0 P01/AD1 P02/AD2 P03/AD3 P04/AD4 P05/AD5 P06/AD6 P07/AD7 DVSS P10/AD8/A8
Pin No.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
Pin Name
P11/AD9/A9 P12/AD10/A10 P13/AD11/A11 P14/AD12/A12 P15/AD13/A13 P16/AD14/A14 P17/AD15/A15 P20/A0/A16 P21/A1/A17 P22/A2/A18 P23/A3/A19 P24/A4/A20 P25/A5/A21 P26/A6/A22 P27/A7/A23 TEST0 PLLOFF DVSS ALE DVCC3 BW1 P30/RD P31/WR P32/HWR P33/WAIT P34/BUSRQ P35/BUSAK P36/R/W P37/DSU DVSS DVCC3 P40/CS0 P41/CS1 P42/CS2 P43/CS3 P44/SCOUT
Pin No.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
Pin Name
P90/KEY8/DCLK P91/KEY9/PCST2 P92/TB4OUT/PCST1 P93/TB5OUT/PCST0 P94/TB6OUT/SDSA0/TPC P95/TB7IN0/DBGE P96/TB7IN1/DINT P97/TB7OUT/DRESET DVCC3 PA0/TB0IN0/INT3 PA1/TB0IN1/INT4 PA2/TB0OUT PA3/TB1IN0/INT5 PA4/TB1IN1/INT6 PA5/TB1OUT PA6/TA1OUT PA7/TA0IN/KEYA DVSS RSTPUP PC0/TA4IN/INT8 PC1/TA6IN/INT9 PC2/TA8IN/INTA PC3/TA5OUT PC4/TAAIN PC5/TA7OUT PC6/TB8IN0/KEYC PC7/TB8IN1/TA9OUT DVCC52 PF0/TXD5 PF1/RXD5/KEYD PF2/SCLK5/CTS5 PF3/SCK PF4/SO/SDA PF5/SI/SCL PF6/INT0 DVCC51
Pin No.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 CVCC X2 CVSS X1 TEST1 RESET
Pin Name
PD6/XT1 PD7/XT2 NMI BW0 PB0/TB2IN0/INTB PB1/TB2IN1/INTC PB2/TB2OUT/TB4IN0 PB3/TB3IN0/INTD PB4/TB3IN1/INTE PB5/TB3OUT/TB4IN1 PB6/TA3OUT DVSS DVCC3 PB7/TA2IN/INT7/KEYB PD0/TXD0/TB9IN0 PD1/RXD0/TB9IN1 PD2/SCLK0/CTS0 PD3/TXD1/TBAIN0 PD4/RXD1/TBAIN1 PD5/SCLK1/CTS1/TABOUT PE0/TXD3 PE1/RXD3 PE2/SCLK3/CTS3 PE3/TXD4 PE4/RXD4 PE5/SCLK4/CTS4 PE6/INT1/BOOT PE7/INT2/INTLV AVCC AVSS
TMP1942CY/CZ-6
TX1942CY/CZ
Figure 2.1.2 shows pin assignment for the 177-pin model of the TMP1942.
A1 B1 C1 D1 E1 F1 G1 H1 J1 K1 L1 M1 N1 P1 R1 A2 B2 C2 D2 E2 F2 G2 H2 J2 K2 L2 M2 N2 P2 R2 A3 B3 C3 D3 E3 F3 G3 H3 J3 K3 L3 M3 N3 P3 R3 A4 B4 C4 D4 E4 F4 G4 H4 J4 K4 L4 M4 N4 P4 R4 M5 N5 P5 R5 M6 N6 P6 R6 M7 N7 P7 R7 M8 N8 P8 R8 M9 N9 P9 R9 M10 N10 P10 R10 M11 N11 P11 R11 A5 B5 C5 D5 A6 B6 C6 D6 A7 B7 C7 D7 A8 B8 C8 D8 A9 B9 C9 D9 A10 B10 C10 D10 A11 B11 C11 D11 A12 B12 C12 D12 E12 F12 G12 H12 J12 K12 L12 M12 N12 P12 R12 A13 B13 C13 D13 E13 F13 G13 H13 J13 K13 L13 M13 N13 P13 R13 A14 B14 C14 D14 E14 F14 G14 H14 J14 K14 L14 M14 N14 P14 R14 A15 B15 C15 D15 E15 F15 G15 H15 J15 K15 L15 M15 N15 P15 R15
Figure 2.1.2 177-Pin CSP Pin Assignment
TMP1942CY/CZ-7
TX1942CY/CZ
Table 2.1.2 Pin Assignment (177-pin CSP) Pin No.
A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B13 B14 B15 C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12 C13 C14 C15 VREFL AVSS AVCC PE7/INT2/INTLV PE3/TXD4 TCK (JTAG) PD2/SCLK0/CTS0 PB5/TB3OUT/TB4IN1 PB1/TB2IN1/INTC PD7/TX2 PD6/TX1 X1 X2 CVCC NC NC NC PE6/INT1 PE4/RXD4 TRST (JTAG) PD5/SCLK1/CTS1/TABOUT PD0/TXD0/TB9IN0 DVCC3 PB4/TB3IN1/INTE PB0/TB2IN0/INTB NC RESET CVSS DVCC51 NC VREFH NC PE5/SCLK4/CTS4 PE2/SCLK3/CTS3 PE1/RXD3 PD4/RXD1/TBAIN1 PD1/RXD0/TB9IN1 PB6/TA3OUT PB3/TB3IN0/INTD BW0 NC TEST1 PF4/SO/SDA PF5/SI/SCL NC
Pin Name
Pin No.
D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 E1 E2 E3 E4 E5 E12 E13 E14 E15 F1 F2 F3 F4 F12 F13 F14 F15 G1 G2 G3 G4 G12 G13 G14 G15 H1 H2 H3 H4 H12
Pin Name
P50/AN0 DAVSS P52/AN2 P51/AN1 PE0/TXD3 PD3/TXD1/TBAIN0 PB7/TA2IN/INT7/KEYB DVSS PB2/TB2OUT/TB4IN0 NMI NC NC PF1/RXD5/KEYD PF3/SCK PF6/INT0 DAVCC DAOUT0 DAREFH P53/AN3
NC (Bonding not applied)
Pin No.
H13 H14 H15 J1 J2 J3 J4 J12 J13 J14 J15 K1 K2 K3 K4 K12 K13 K14 K15 L1 L2 L3 L4 L12 L13 L14 L15 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 M13 M14 M15 N1 N2 N3 NC NC
Pin Name
Pin No.
N4 N5 N6 N7 N8 N9 N10 N11 N12 N13 N14 N15 P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 P15 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15
Pin Name
P16/AD14/A14 P21/A1/A17 P25/A5/A21 DVSS TEST0 P30/RD P32/HWR P37 DVSS P41/CS1 P91/KEY9 NC NC P10/AD8/A8 P12/AD10/A10 P20/A0/A16 P22/A2/A18 P26/A6/A22 TDO (JTAG) ALE BW1 P33/WAIT TDI (JTAG) P40/CS0 P42/CS2 P44/SCOUT NC P11/AD9/A9 NC NC P13/AD11/A11 P17/AD15/A15 P23/A3/A19 P27/A7/A23 NC P31/WR P35/BUSAK DVCC3 NC P43/CS3 NC P90/KEY8
DVSS P67/AN15/KEY7 P65/AN13/KEY5 P66/AN14/KEY6 P64/AN12/KEY4 PA6/TA1OUT PA7/TA0IN/KEYA NC PA5/TB1OUT P01/AD1 DVCC3 NC NC PA2/TB0OUT PA3/TB1IN0/INT5 PA4/TB1IN1/INT6 PA1/TB0IN1/INT4 P04/AD4 P02/AD2 TMS (JTAG) P00/AD0 P97/TB7OUT DVCC3 PA0/TB0IN0/INT3 P96/TB7IN1 P07/AD7 P05/AD5 P03/AD3 P14/AD12/A12 P15/AD13/A13 P24/A4/A20 PLLOFF NC DVCC3 P34/BUSRQ P36/R/W P93/TB5OUT P94/TB6OUT P95/TB7IN0 P92/TB4OUT NC DVSS P06/AD6
PC6/TB8IN0/KEYC DVCC52 PF0/TXD5 PF2/SCLK5/CTS5 DAOUT1 P55/AN5 P54/AN4 DAOUT2 PC2/TA8IN/INTA PC4/TAAIN PC5/TA7OUT PC7/TB8IN1/TA9OUT P56/AN6 P61/AN9/KEY1 NC P60/AN8/KEY0 PC0/TA4IN/INT8 PC1/TA6IN/INT9 NC PC3/TA5OUT DVSS P63/AN11/KEY3 P57/AN7/ADTRG P62/AN10/KEY2 RSTPUP
TMP1942CY/CZ-8
TX1942CY/CZ
2.2
Pin Usage Information
Table 2.2.1 lists the names and functions of the TMP1942's input/output pins. Table 2.2.1 Pin Names and Functions
Pin Name # of Pins
P00~P07 AD0~AD7 P10~P17 AD8~AD15 A8~A15 P20~P27 A0~A7 A16~A23 P30 RD P31 WR P32 HWR P33 WAIT P34 BUSRQ P35 BUSAK P36 R/W P37 DSU 1 1 1 1 1 1 1 1 8 8 8
Type
Input/output Input/output Input/output Input/output Output Input/output Output Output Output Output Output Output Input/output Output Input/output Input Input/output Input Input/output Output Input/output Output Input/output Input
Function
Port 0: Individually programmable as input or output Address (Lower): Bits 0-7 of the address/data bus Port 1: Individually programmable as input or output Address/Data (Upper): Bits 8-15 of the address/data bus Address: Bits 8-15 of the address bus Port 2: Individually programmable as input or output Address: Bits 0-7 of the address bus Address: Bits 16-23 of the address bus Port 30: Output-only Read Strobe: Asserted during a read operation from an external memory device Port 31: Output-only Write Strobe: Asserted during a write operation on D0-D7 Port 32: Programmable as input or output (with internal pull-up resister) Higher Write Strobe: Asserted during a write operation on D8-D15 Port 33: Programmable as input or output (with internal pull-up resister) Wait: Causes the CPU to suspend external bus activity Port 34: Programmable as input or output (with internal pull-up resister) Bus Request: Asserted by an external bus master to request bus mastership Port 35: Programmable as input or output (with internal pull-up resister) Bus Acknowledge: Indicates that the CPU has relinquished the bus in response to BUSRQ . Port 36: Programmable as input or output (with internal pull-up resister) Read/Write: Indicates the direction of data transfer on the bus: 1 = read or dummy cycle, 0 = write cycle Port 37: Programmable as input or output (with internal pull-up resister) This pin is used to select the operating mode during reset. The TMP1940CYAF enters NORMAL mode when this pin is sampled high at the rising edge of RESET . This pin should not be pulled down to a logic 0 during a reset sequence. The TMP1940FDBF, which has an on-chip flash, uses this pin as an interface to the DSU tool. For details, refer to Part 4, TMP1940FDBF. Port 40: Programmable as input or output (with internal pull-up resister) Chip Select 0: Asserted low to enable external devices at programmed addresses Port 41: Programmable as input or output (with internal pull-up resister) Chip Select 1: Asserted low to enable external devices at programmed addresses Port 42: Programmable as input or output (with internal pull-up resister) Chip Select 2: Asserted low to enable external devices at programmed addresses Port 43: Programmable as input or output (with internal pull-up resister) Chip Select 3: Asserted low to enable external devices at programmed addresses Port 44: Programmable as input or output System Clock Output: Drives out a clock signal at the same frequency as the CPU clock (high-speed or low-speed) Port 5: Input-only Analog input: Input to the A/D converter External start request for the A/D converter (multiplexed with P57) Port 6: Input-only Analog input: Input to the A/D converter Key on wake-up input (with internal pull-up resister) (dynamic pull-up selectable) Port 90: Programmable as input or output DSU pin Key on wake-up input (with internal pull-up resister) (dynamic pull-up selectable)
P40 CS0 P41 CS1 P42 CS2 P43 CS3 P44 SCOUT P50~P57 AN0~AN7 ADTRG P60~P67 AN8~AN15 KEY0-KEY7 P90 DSU (DCLK) KEY8
1 1 1 1 1
Input/output Output Input/output Output Input/output Output Input/output Output Input/output Output
8
Input Input Input
1
Input/output Input Output
1
Input/output Output Input
TMP1942CY/CZ-9
TX1942CY/CZ
Pin Name # of Pins
P91 DSU (PCST2) KEY9 P92 DSU (PCST1) TB40UT P93 DSU (PCST0) TB5OUT P94 DSU (SDSA0/TPC) TB6OUT P95 DSU (DBGE*) TB7IN0 P96 DSU (DINT*) TB7IN1 P97 DSU (DRESET) TB7OUT PA0 TB0IN0 INT3 PA1 TB0IN1 INT4 PA2 TB0OUT PA3 TB1IN0 INT5 PA4 TB1IN1 INT6 PA5 TB1OUT PA6 TA1OUT PA7 TA0IN KEYA PB0 TB2IN0 INTB 1 1 1 1 1 1 1 1 1 Output Input/output Input Input Input/output Input Input Input/output Output Input/output Input Input Input/output Input Input Input/output Output Input/output Output Input/output Input Input Input/output Input Input 16-Bit Timer 7 Output: Output from 16-bit Timer 7 Port A0: Programmable as input or output 16-Bit Timer 0 Input 0: Count/capture trigger input to 16-bit Timer 0 Interrupt Request 3: Programmable to be high-level, low-level, rising-edge or falling-edge sensitive 1 Input/output Input 1 Input/output Input 1 Output Input/output Input 16-Bit Timer 6 Output: Output from 16-bit Timer 6 Port 95: Programmable as input or output DSU pin 16-Bit Timer 7 Input 0: Count/capture trigger input to 16-bit Timer 7 Port 96: Programmable as input or output DSU pin 16-Bit Timer 7 Input 1: Capture trigger input to 16-bit Timer 7 Port 97: Programmable as input or output DSU pin 1 1 1 1
Type
Input/output Output Input Input/output Output Output Input/output Output Output Input/output Output DSU pin
Function
Port 91: Programmable as input or output Key on wake-up input (with internal pull-up resister) (dynamic pull-up selectable) Port 92: Programmable as input or output DSU pin 16-Bit Timer 4 Output: Output from 16-bit Timer 4 Port 93: Programmable as input or output DSU pin 16-Bit Timer 5 Output: Output from 16-bit Timer 5 Port 94: Programmable as input or output DSU pin
Port A1: Programmable as input or output 16-Bit Timer 0 Input 1: Capture trigger input to 16-bit Timer 0 Interrupt Request 4: Programmable to be high-level, low-level, rising-edge or falling-edge sensitive
Port A2: Programmable as input or output 16-Bit Timer 0 Output: Output from 16-bit Timer 0 Port A3: Programmable as input or output 16-Bit Timer 1 Input 0: Count/capture trigger input to 16-bit Timer 1 Interrupt Request 5: Programmable to be high-level, low-level, rising-edge or falling-edge sensitive
Port A4: Programmable as input or output 16-Bit Timer 1 Input 1: Capture trigger input to 16-bit Timer 1 Interrupt Request 6: Programmable to be high-level, low-level, rising-edge or falling-edge sensitive
Port A5: Programmable as input or output 16-Bit Timer 1 Output: Output from 16-bit Timer 1 Port A6: Programmable as input or output 8-Bit Timer 0/1 Output: Output from 8-bit Timer 0 or 1 Port A7: Programmable as input or output 8-Bit Timer 0 Input: Input to 8-bit Timer 0 Key on wake-up input (with internal pull-up resister) (dynamic pull-up selectable) Port B0: Programmable as input or output 16-Bit Timer 2 Input 0: Count/capture trigger input/2-phase input pulse counter input to 16-bit Timer 2 Interrupt Request B: Programmable to be high-level, low-level, rising-edge or falling-edge sensitive
TMP1942CY/CZ-10
TX1942CY/CZ
Pin Name # of Pins
PB1 TB2IN1 INTC 1
Type
Input/output Input Input
Function
Port B1: Programmable as input or output 16-Bit Timer 2 Input 1: Capture trigger input/2-phase input pulse counter input to 16-bit Timer 2 Interrupt Request C: Programmable to be high-level, low-level, rising-edge or falling-edge sensitive
PB2 TB2OUT TB4IN0 PB3 TB3IN0 INTD
1
Input/output Output Input
Port B2: Programmable as input or output 16-Bit Timer 2 Output: Output from 16-bit Timer 2 16-Bit Timer 4 Input 0: Count/capture trigger input to 16-bit Timer 4 Port B3: Programmable as input or output 16-Bit Timer 3 Input 0: Count/capture trigger input/2-phase input pulse counter input to 16-bit Timer 3 Interrupt Request D: Programmable to be high-level, low-level, rising-edge or falling-edge sensitive
1
Input/output Input Input
PB4 TB3IN1 INTE
1
Input/output Input Input
Port B4: Programmable as input or output 16-Bit Timer 3 Input 1: Capture trigger input/2-phase input pulse counter input to 16-bit Timer 3 Interrupt Request E: Programmable to be high-level, low-level, rising-edge or falling-edge sensitive
PB5 TB3OUT TB4IN1 PB6 TA3OUT PB7 TA2IN INT7 KEYB PC0 TA4IN INT8 PC1 TA6IN INT9 PC2 TA8IN INTA PC3 TA5OUT PC4 TAAIN PC5 TA7OUT PC6 TB8IN0 KEYC PC7 TB8IN1 TA9OUT PD0 TXD0 TB9IN0
1
Input/output Output Input
Port B5: Programmable as input or output 16-Bit Timer 3 Output: Output from 16-bit Timer 3 16-Bit Timer 4 Input 1: Capture trigger input to 16-bit Timer 4 Port B6: Programmable as input or output 8-Bit Timer 2/3 Output: Output from 8-bit Timer 2 or 3 Port B7: Programmable as input or output 8-Bit Timer 2 Input: Input to 8-bit Timer 2 Interrupt Request 7: Programmable to be high-level, low-level, rising-edge or falling-edge sensitive Key on wake-up input (with internal pull-up resister) (dynamic pull-up selectable) Port C0: Programmable as input or output 8-Bit Timer 4 Input: Input to 8-bit Timer 4 Interrupt Request 8: Programmable to be high-level, low-level, rising-edge or falling-edge sensitive Port C1: Programmable as input or output 8-Bit Timer 6 Input: Input to 8-bit Timer 6 Interrupt Request 9: Programmable to be high-level, low-level, rising-edge or falling-edge sensitive Port C2: Programmable as input or output 8-Bit Timer 8 Input: Input to 8-bit Timer 8 Interrupt Request A: Programmable to be high-level, low-level, rising-edge or falling-edge sensitive Port C3: Programmable as input or output 8-Bit Timer 4/5 Output: Output from 8-bit Timer 4 or 5 Port C4: Programmable as input or output 8-Bit Timer A Input: Input to 8-bit Timer A Port C5: Programmable as input or output 8-Bit Timer 6/7 Output: Output from 8-bit Timer 6 or 7 Port C6: Programmable as input or output 16-Bit Timer 8 Input 0: Count/capture trigger input to 16-bit Timer 8 Key on wake-up input (with internal pull-up resister) (dynamic pull-up selectable) Port C7: Programmable as input or output 16-Bit Timer 8 Input 1: Capture trigger input to 16-bit Timer 8 8-Bit Timer 8/9 Output: Output from 8-bit Timer 8 or 9 Port D0: Programmable as input or output Serial Transmit Data 0 Programmable as an open-drain output 16-Bit Timer 9 Input 0: Count/capture trigger input to 16-bit Timer 9
1 1
Input/output Output Input/output Input Input Input
1
Input/output Input Input
1
Input/output Input Input
1
Input/output Input Input
1 1 1 1
Input/output Output Input/output Input Input/output Output Input/output Input Input
1
Input/output Input Output
1
Input/output Output Input
TMP1942CY/CZ-11
TX1942CY/CZ
Pin Name # of Pins
PD1 RXD0 TB9IN1 PD2 SCLK0 CTS0* PD3 TXD1 TBAIN0 PD4 RXD1 TBAIN1 PD5 SCLK1 CTS1 TABOUT PD6 XT1 PD7 XT2 PE0 TXD3 PE1 RXD3 PE2 CTS3* 1 1 1 1 1 1 1 1 1 1
Type
Input/output Input Input Input/output Input/output Input Input/output Output Input Input/output Input Input Input/output Input/output Input Output Input/output Input Input/output Output Input/output Output Input/output Input Input/output Input/output Input Serial Receive Data 0
Function
Port D1: Programmable as input or output 16-Bit Timer 9 Input 1: Capture trigger input to 16-bit Timer 9 Port D2: Programmable as input or output Serial Clock Input/Output 0 Serial Clear-to-Send 0 Programmable as an open-drain output Port D3: Programmable as input or output Serial Transmit Data 1 Programmable as an open-drain output 16-Bit Timer A Input 0: Count/capture trigger input to 16-bit Timer A Port D4: Programmable as input or output Serial Receive Data 1 16-Bit Timer A Input 1: Capture trigger input to 16-bit Timer A Port D5: Programmable as input or output Serial Clock Input/Output 1 Serial Clear-to-Send 1 Programmable as an open-drain output 8-Bit Timer A/B Output: Output from 8-bit Timer A or B Port D6: Programmable as input or open-drain output Connection pin for a low-speed crystal Port D7: Programmable as input or open-drain output Connection pin for a low-speed crystal Port E0: Programmable as input or output Serial Transmit Data 3 Programmable as an open-drain output Port E1: Programmable as input or output Serial Receive Data 3 Port E2: Programmable as input or output Serial Clock Input/Output 3 Serial Clear-to-Send 3 Programmable as an open-drain output Port E3: Programmable as input or output Serial Transmit Data 4 Programmable as an open-drain output Port E4: Programmable as input or output Serial Receive Data 4 Port E5: Programmable as input or output Serial Clock Input/Output 4 Serial Clear-to-Send 4 Programmable as an open-drain output Port E6: Programmable as input or output Interrupt request 1: Individually programmable to be high-level, low-level, rising-edge or falling-edge sensitive.
PE3 TXD4 PE4 RXD4 PE5 SCLK4 CTS4 PE6 INT1 BOOT
1
Input/output Output
1 1
Input/output Input Input/output Input/output Input
1
Input/output Input
Single-boot mode setting pin: Used when rewriting built-in flash memory (low active). During normal operation, this pin should be pulled up. This pin should always be pulled up for the mask ROM version. PE7 INT2 INTLV 1 Input/output Input Port E7: Programmable as input or output Interrupt request 2: Individually programmable to be high-level, low-level, rising-edge or falling-edge sensitive.
Interleave mode setting pin: This pin should be pulled up when using interleave mode. Otherwise, it should be pulled down. PF0 TXD5 1 Input/output Output Port F0: Programmable as input or output Serial Transmit Data 5 Programmable as an open-drain output
TMP1942CY/CZ-12
TX1942CY/CZ
Pin Name # of Pins
PF1 RXD5 KEYD PF2 SCLK5 CTS5 PF3 SCK PF4 SO SDA PF5 SI SCL PF6 INT0 ALE TEST0 TEST1 RSTPUP DAOUT0-2 NMI BW0~1 PLLOFF RESET VREFH VREFL AVCC AVSS DAVCC DAVSS DAREFH X1/X2 CVCC CVSS DVCC3 DVCC51 DVCC52 DVSS 1 1 1 1 3 1 2 1 1 1 1 1 1 1 1 1 2 1 1 4 1 1 5 1 1 1 1 1
Type
Input/output Input Input Input/output Input/output Input Input/output Input/output Input/output Output Input/output Input/output Input Input/output Input/output Input Output Input Input Input Output Input Input Input Input Input Input Input/output Serial Receive Data 5
Function
Port F1: Programmable as input or output Key on wake-up input (with internal pull-up resister) (dynamic pull-up selectable) Port F2: Programmable as input or output Serial Clock Input/Output 5 Serial Clear-to-Send 5 Programmable as an open-drain output Port F3: Programmable as input or output Clock input/output pin when the serial bus interface is in SIO mode Port F4: Programmable as input or output Data transmission pin when the serial bus interface is in SIO mode Data transmission/reception pin when the serial bus interface is in I C mode Programmable as an open-drain output Port F5: Programmable as input or output Data reception pin when the serial bus interface is in SIO mode Clock input/output pin when the serial bus interface is in I C mode Programmable as an open-drain output Port F6: Programmable as input or output Interrupt request 0: Individually programmable to be high-level, low-level, rising-edge or falling-edge sensitive. Address Latch Enable (This signal is driven out only when external memory is accessed) Test pin Test pin When this pin is driven high (upon reset), pull-up for ports 3 and 4 is enabled. When this pin is driven low, pull-up is disabled. D/A converter output Non-maskable Interrupt Request: Causes an NMI interrupt on the falling edge Set both AM0 and AM1 to 1. This pin should be tied to logic 1 when the frequency multiplied clock from the PLL is used; otherwise, it should be tied to logic 0. Reset (with internal pull-up resister): Initializes the whole TMP1940CYAF Input pin for high reference voltage for the A/D converter. Input pin for low reference voltage for the A/D converter. Power supply pin for the A/D converter. This pin should always be connected to power supply even when the A/D converter is not used. Ground pin for the A/D converter. This pin should always be connected to ground even when the A/D converter is not used. Power supply pin for the D/A converter. This pin should always be connected to power supply even when the D/A converter is not used. Ground pin for the D/A converter. This pin should always be connected to ground even when the D/A converter is not used. Reference voltage input pin for the D/A converter Resonator connecting pin Power supply pin for the oscillator Ground pin for the oscillator (0 V) Power supply pins Power supply pin (port F) Power supply pin (port C) Ground pins (0 V)
2 2
Port C becomes a 5 V port when a 5 V power supply is connected to DVCC52. Port F becomes a 5 V port when a 5 V power supply is connected to DVCC51.
Note: When the DSU is enabled, port 9 functions as the processor probe interfacing signal regardless of the setting of the port 9 control register (P9CR).
TMP1942CY/CZ-13
TX1942CY/CZ
The following table lists the JTAG specific pins added to the CSP package: Pin Name # of Pins
TRST TCK TDI TDO TMS 1 1 1 1 1
Type
Input Input Input Output Input
Function
JTAG reset pin (with internal pull-up resistor) JTAG clock pin (with internal pull-up resistor) JTAG data input pin (with internal pull-up resistor) JTAG data output pin JTAG mode switching input pin (with internal pull-up resistor)
TMP1942CY/CZ-14
TMP1942CY/CZ
3.
Functional Description
This section describes the functions and basic operation of each individual circuit block in the TMP1942 series devices.
3.1
Processor Core
The TX1942 contains a high-performance 32-bit processor core (the TX19 processor core). For details of the operation of the processor core, refer to "TX19 Family Architecture". Functions unique to the TMP1942, which are not explained in "TX19 Family Architecture", are described below. Recommended power-on sequence: In powering up this device, it is recommended that the DVCC3 be turned on first. At power-on, the pull-up resistors and input & output buffers pull-down resistors attached to the I/O ports of the 5V supply domain may rail become unstable or a through current may pass through the port until the DVCC3 has stabilized, when an injection order is not kept.
3.1.1
Reset Operation
To reset the TMP1942, RESET must be input Low (at 0) for at least 12 system clock cycles while the power supply voltage is within the rated operating range and the internal high-frequency oscillator is oscillating stably. (With the device operating at 32 MHz, this period is equal to 3 s if the PLL is being used and 6 s if the PLL is not being used.) After a reset the PLL-multiplied clock is specified by the setting of the PLLOFF pin and the clock gear is initialized to 1/8 mode.
To reset the TMP1942, RESET must be asserted for at least 12 system clock periods after the power supply voltage and the internal high-frequency oscillator have stabilized. This time is typically 3 s at 32 MHz when the on-chip PLL is utilized, and 6s otherwise. After a reset, either the PLL-multiplied clock or an external clock is selected, depending on the logic state of the PLLOFF pin. By default, the selected clock is geared down to 1/8 for internal operation. The following occurs as a result of a reset: * * The System control coprocessor (CP0) registers within the TX19 core processor are initialized. For details, refer to the Architecture manual. The Reset exception is taken. Program control is transferred to the exception handler at a predefined address. This predefined location is called an exception vector, which directly indicates the start of the actual exception handler routine. The Reset exception is always vectored to virtual address 0xBFC0_0000 (which is the same as for the Nonmaskable Interrupt exception). All on-chip I/O peripheral registers are initialized. All port pins, including those multiplexed with on-chip peripheral functions, are configured as either general-purpose inputs or general-purpose outputs.
* *
TMP1942CY/CZ-15
TMP1942CY/CZ
3.2
Memory Map
Figure 3.2.1 shows a memory map of the TMP1942.
Virtual address 0xFFFF_FFFF 16 Mbytes reserved 0xFF00_0000 Kseg2 (cacheable) 0xC000_0000 0xBFC0_0000 Kseg1 (uncacheable) 0xA000_0000 Kseg0 (cacheable) 0x8000_0000 16 Mbytes reserved
Physical address 16 Mbytes reserved Kseg2 (1 Gbyte) 16 Mbytes reserved Internal I/O (Reserved)
Internal RAM (16KB)
0xFFFF_E000 0xFFFF_AFFF 0xFFFF_7000
(Reserved) Reserved for debugging (2 MB) 0xFF3F_FFFF 0xFF20_0000 (Reserved) 0xFF00_0000
Kuseg (2Gbyte)
Internal ROM area reflected Kuseg (cacheable) Cannot be accessed Internal ROM 0x0007_FFFF 0x0000_0000 512 Mbytes
0x4003_FFFF 0x4000_0000 0x1FC3_FFFF 0x1FC0_0000 User program area
0x1FC3_FFFF
0x1FC0_0400 Maskable interrupt area Exception vector area 0x1FC0_0000
Figure 3.2.1 Memory Map
Note 1: The internal ROM is mapped into the memory space from 0x1FC0_0000 to 0x1FC3_FFFF (for a 256-KB ROM) or 0x1FC0_0000 to 0x1FC5_FFFF (for a 384-KB ROM). The internal RAM is mapped into the memory space from 0xFFFF_8000 to 0xFFFF_BFFF (for a 16-KB RAM). Note 2: The memory space from 0xFFFF_4000 to 0xFFFF_BFFF is a reserved RAM area. Any area other than those shown above, where physical memory is located, should not be accessed. Note 3: The internal memory data is stored in contiguous physical address locations starting at 0x1FC0_0000. If exception vector addresses are placed in internal ROM, the system control coprocessor (CP0) Status register's BEV bit must be set to 1 (the default). (This is because exception vector addresses are dispersed if BEV = 0.) If memory is added externally, the BEV bit can be set to 0. However, since a virtual address space of 0x0000_0000 32 KB is easier to access for reasons of code efficiency, this area is reflected in the contiguous physical address space from 0x4000_0000 upwards (as indicated by the shaded area) which corresponds to a virtual address space starting at 0x0000_0000 and which is equal in size to the internal memory. Hence, accessing this area is equivalent to accessing the internal memory. Example: Using 32-bit ISA * Access to the 0x0000_0000 32 KB area ADDIU SW r2, r0, 7 ; r 2 (0x0000_0007) r2, Io (_t) (r0) ; 0x0000_xxxx (r2) Can be accessed using a single instruction. * Access to areas other than 0x0000_0000 32 KB LUI ADDIU SW Note 4: r3, hi (_f) r2, r0, 8 ; Upper address is set to r3. ; r2 (0x0000_0008)
r2, Io (_f) (r3) ; Memory is accessed after lower address has been set.
The TX1942 supports access to only 16 Mbytes of physical space as external address space. A 16-Mbyte physical address space can be placed in any chip-select area within the CPU's 3.5 Gbytes of physical address space. However, when access to the internal memory, internal I/O space or a reserved area is performed, the external address space cannot be accessed simultaneously, since the other types of access have priority.
Note 5:
Do not place an instruction in the last four words of the physical area. * The relevant area of the internal ROM is 0x1FC3_FFF0 to 0x1FC3_FFFF (for a 256-KB ROM) or 0x1FC5_FFF0 to 0x1FC5_FFFF (for a 384-KB ROM). * If ROM is added externally, this restriction applies to the last four words of the installed memory (system-dependent).
TMP1942CY/CZ-16
TMP1942CY/CZ
3.3
Clock/Standby Control
There are essentially two modes of clock operation: single-clock mode (which uses only the X1 and X2 pins) and dual-clock mode (which uses the X1 and X2 pins as well as the XT1 and XT2 pins). Figure 3.3.1 shows the state transition diagram for each operation mode.
Reset Reset terminated IDLE mode (CPU halted) (I/O select operation) Instruction Interrupt NORMAL mode (fc/gear value) Instruction Interrupt STOP mode (all circuits turned off)
(a) State transition in single-clock mode
Reset Reset terminated IDLE mode (CPU halted) (I/O select operation) Instruction Interrupt Instruction Interrupt SLEEP mode (fc only) (only real-time clock timer operating) Instruction Interrupt NORMAL mode (fc/gear value) Instruction Instruction Interrupt Instruction Interrupt STOP mode (all circuits turned off)
SLOW mode (fs)
Note 1: Note 2: Note 3:
Before transition to SLOW/SLEEP mode can occur, the low-speed oscillator (fs) must be oscillating stably. When SLEEP mode is terminated, the device returns to the state in which it was placed before entering SLEEP mode. The state to which the device returns when STOP mode is terminated can be specified using system control register SYSCR0.
(b) State transition in dual-clock mode Figure 3.3.1 State Transition Diagrams for Different Modes
Reset Reset terminated PLLOFF pin (High) PLL clock used NORMAL mode fc = fpll = fosc x 4 fsys = fc/8 fsys = fosc/2 fperiph = fsys Reset
Reset terminated PLLOFF pin (Low) PLL not used
NORMAL mode fc = fosc/2 fsys = fc/8 fsys = fosc/16 fperiph = fsys
A. When a clock generated by the PLL is used
B. When the PLL is not used
Figure 3.3.32 Default States When the PLL is Used and Those When the PLL is Not Used fosc: fs: fpll: fc: fgear: fperiph: Clock frequency input via X1 and X2 pins Clock frequency input via XT1 and XT2 pins Clock frequency multiplied (x4) by PLL Clock frequency selected by setting of PLLOFF pin Clock frequency selected by SYSCR1 Input clock for peripheral I/O prescaler
System clock fsys: Clock frequency selected by SYSCR1
TMP1942CY/CZ-17
TMP1942CY/CZ 3.3.1 Block Diagram of Clock Circuits
1. Main system clock * * * * A crystal can be connected between X1 and X2, or X1 can be externally driven with a clock.
PLLOFF The on-chip PLL can be enabled or disabled (bypassed) during reset by using the PLLOFF pin. When the PLL is enabled, the input clock frequency is multiplied by four.
The clock gear can be programmed to divide the clock by 2, 4 or 8. (The default is 1/8 on reset.) Input clock frequency Input Frequency Range fmax
32 MHz 20 MHz 20 MHz 16 MHz
*1
fmin
2.5 MHz 1 MHz 1 MHz 1.25 MHz
PLLON (for both resonator and external input) Resonator PLLOFF External input
5~8 (MHz) 16~20 (MHz) 16~20 (MHz) 2032 (MHz)
*1. SYSCR1 must be 0. The default is 0.
2.
Sub-system clock * * * Generated using a 32.768-kHz resonator (external input also accepted). SLOW mode: The CPU runs at low speed. SLEEP mode: Only the timer for real-time clock, 2-phase pulse input counter, and dynamic pull-up operate.
TMP1942CY/CZ-18
TMP1942CY/CZ
3. Block diagram
SYSCR0 SYSCR2 SYSCR3 SYSCR1
SYSCR0 fs XT1 XT2 Low-speed oscillator SYSCR0 X1 X2
Warm-up timer Lock-up (PLL) timer
fgear fc
fperiph (to peripheral I/O) fs
Fpll = fosch x 4 Selector PLL
/2 /2 /4 /8
fsys
SYSCR1 SYSCR1 Divide by 8 after reset
High-speed oscillator fosc
PLLOFF (default pin setting)
SYSCR1 fsys SYSCR0 CPU
ROM RAM Peripheral I/O (prescaler input) TMRA/B, SIO SBI, ADC DMAC INTC
/2
fperiph
/2
/4
Peripheral I/O ADC,DA,TMRA/B, SIO,SBI,PIO, WDT, RTC
fs
Timer for real-time clock 2-phase pulse input counter KWUP
SYSCR3 SCOUT
Note 1: When using the clock gear to reduce the system clock frequency, make sure that Tn of the prescaler output for each peripheral I/O block satisfies the following relationship: TnTMP1942CY/CZ-19
TMP1942CY/CZ 3.3.2 Clock Generator (CG) Registers
(1) Clock-related registers 7
SYSCR0 Bit Symbol After reset Function XEN 1 (0xFFFF_EE00) Read/Write 0 1 0 Low-speed oscillator after exit from STOP mode High-speed Low-speed High-speed oscillator oscillator oscillator after exit from STOP mode
6
XTEN
5
RXEN
4
RXTEN R/W
3
RSYSCK 0 Clock selection after exit from STOP mode
2
WUEF 0
1
PRCK1 0
0
PRCK0 0
Oscillator Prescaler clock selection warm-up timer (WUP) 00: fperiph/4 control 01: fperiph/2 Write 0: 10: fperiph Don't care 11: (reserved) Write 1:
0: Turned off 0: Turned off 0: Turned off 0: Turned off 0: High speed WUP start 1: Oscillating 1: Oscillating 1: Oscillating 1: Oscillating 1: Low speed Read 0: WUP finished Read 1: WUP operating
15
SYSCR1 Bit Symbol After reset Function (0xFFFF_EE01) Read/Write
14
13
SYSCK R/W
12
FPSEL 0 fperiph selection
11
DFOSC 0 High-speed oscillator frequency division selection
0: Divide by 2 1: Divide by 1
10
9
GEAR1 R/W
8
GEAR0 1
-
0 System clock selection
-
1
High-speed clock (fc) gear selection
0: High speed 0: fgear (fc) 1: fc 1: Low speed (fs)
00: fc 01: fc/2 10: fc/4 11: fc/8
23
SYSCR2 Bit Symbol After reset Function (0xFFFF_EE02) Read/Write 0 High-speed oscillator driving capability control 0: Normal 1: Weak
22
21
WUPT1 R/W 1
20
WUPT0 0
19
STBY1 1
18
STBY0
17
-
16
DRVE R/W 0 1: Pins are also driven in STOP mode.
DRVOSCH DRVOSCL 0
1
-
Low-speed Oscillator warm-up time oscillator selection driving capability 2 control 00: 2 /input frequency 8 01: 2 /input frequency 14 0: Normal 10: 2 /input frequency 16 11: 2 /input frequency 1: Weak
Standby mode selection
00: Reserved 01: STOP mode 10: SLEEP mode 11: IDLE mode
31
SYSCR3 Bit Symbol After reset Function (0xFFFF_EE03) Read/Write
30
SCOSEL R/W 0 SCOUT output selection 0: fs 1: fsys
29
-
28
ALESEL R/W 1 ALE output width selection
0: fsys x 0.5 1: fsys x 1.5
27
-
26
-
25
LUPFG R 0
24
LUPTM R/W 0
selection
Lock-up flag Lock-up time
0: LUP finished 1: LUP in operation 0: 216/input frequency 1: 212/input frequency
TMP1942CY/CZ-20
TMP1942CY/CZ
Note 1: Standby mode selection depends on the settings of the Doze and Halt bits in the CP0's internal Config register. If the Halt bit = 1, the device will enter the mode selected by STBY[1:0]. If the Doze bit = 1, the device will always enter IDLE mode. Note 2: When the PLL is not used, set the LUPTM bit in the SYSCR3 register to 1 (i.e., select 212/input frequency). Note3: The WURT1-WUPT0 bitys in the SYSCR2 must be not be changed during the oscillator warm-up event ( e.g. SLEEP-NORMAL-SLEEP) Note 4: Do as follows to change the operating mode immediately after the device has warmed up from the clock stop state (e.g., from SLEEP mode to NORMAL mode to SLEEP mode).
* Warming up by hardware (1) Moving from STOP or SLEEP mode to NORMAL mode 1) When the PLL is used Before moving to the next operating mode, ensure that the lock-up bit, LUPFG, in the SYSCR3 register has been cleared to zero and wait for five or more instructions to complete (including the instruction to check the LUPFG flag). 2) When the PLL is not used * When the oscillator warm-up time (SYSCR2) is programmed as "01" (i.e., 28/input frequency). Before moving to the next operating mode, ensure that the lock-up bit, LUPFG, in the SYSCR3 register has been cleared to zero and wait for five or more instructions to complete. * When the oscillator warm-up time (SYSCR2) is programmed as "10" (214/input frequency) or "11" (216/input frequency). Before moving to the next operating mode, wait for five or more instructions to complete. (2) Moving from STOP or SLEEP mode to SLOW mode It is possible to move to SLOW mode immediately after the device has warmed up from STOP or SLEEP mode. * Warming up by software (1) Moving from SLOW mode to NORMAL mode 1) When the PLL is used It is possible to move to NORMAL mode immediately after the device has warmed up. However, to move to another mode after that, ensure that the lock-up bit, LUPFG, in the SYSCR3 register has been cleared to zero and wait for five or more instructions to complete (including the instruction to check the LUPFG flag). 2) When the PLL is not used * When the oscillator warm-up time (SYSCR2) is programmed as "01" (i.e., 28/input frequency). It is possible to move to NORMAL mode immediately after the device has warmed up. However, to move to another mode after that, ensure that the lock-up bit, LUPFG, in the SYSCR3 register has been cleared to zero and wait for five or more instructions to complete.
* When the oscillator warm-up time (SYSCR2) is programmed as "10" (214/input frequency) or "11" (216/input frequency). It is possible to move to NORMAL mode immediately after the device has warmed up. However, to move to another mode after that, wait for five or more instructions to complete.
(2) Moving from NORMAL mode to SLOW mode Before moving to SLOW mode, ensure that the warm-up end flag (i.e., the WUEF bit in the SYSCR0 register) is cleared and wait for five or more instructions to complete.
TMP1942CY/CZ-21
TMP1942CY/CZ
(2) Standby (STOP/SLEEP mode) termination interrupts 7
Bit Symbol IMCGA0 (0xFFFF_EE10) Read/Write After reset Function

6

5
EMCG01 1 R/W
4
EMCG00
3
2

1

0
INT0EN R/W 0 INT0 request input 0: Disable 1: Enable
0
Active state setting for INT0 standby termination request 00: Low level 01: High level 10: Falling edge 11: Rising edge
15
Bit Symbol Read/Write After reset Function

14

13
EMCG11 1 R/W
12
EMCG10 0
11
DFOSC

10

9

8
INT1EN R/W 0 INT1 request input 0: Disable 1: Enable
Active state setting for INT1 standby termination request 00: Low level 01: High level 10: Falling edge 11: Rising edge
23
Bit Symbol Read/Write After reset Function

22

21
EMCG21 1 R/W
20
EMCG20
19
18

17

16
INT2EN R/W 0 INT2 request input 0: Disable 1: Enable
0
Active state setting for INT2 standby termination request 00: Low level 01: High level 10: Falling edge 11: Rising edge
31
Bit Symbol Read/Write After reset Function

30

29
EMCG31 1 R/W
28
EMCG30
27
26

25

24
INT3EN R/W 0 INT3 request input 0: Disable 1: Enable
0
Active state setting for INT3 standby termination request 00: Low level 01: High level 10: Falling edge 11: Rising edge
TMP1942CY/CZ-22
TMP1942CY/CZ
7
IMCGB0 Bit Symbol (0xFFFF_EE14) Read/Write After reset Function

6

5
EMCG41 1 R/W
4
EMCG40
3
2

1

0
INT4EN R/W 0 INT4 request input 0: Disable 1: Enable
0
Active state setting for INT4 standby termination request 00: Low level 01: High level 10: Falling edge 11: Rising edge
15
Bit Symbol Read/Write After reset Function

14

13
EMCG51 1 R/W
12
EMCG50
11
10

9

8
KWUPEN R/W 0 KWUP request input 0: Disable 1: Enable
0
These bits should always be set to 01.
23
Bit Symbol Read/Write After reset Function

22

21
EMCG61 1 R/W
20
EMCG60
19
18

17

16
INTBCDEEN
R/W 0 INTBCDE request input 0: Disable 1: Enable
0
These bits should always be set to 01.
31
Bit Symbol Read/Write After reset Function

30

29
EMCG71 1 R/W
28
EMCG70
27
26

25

24
INTRTCEN R/W 0 INTRTCEN request input 0: Disable 1: Enable
0
These bits should always be set to 11.
TMP1942CY/CZ-23
TMP1942CY/CZ
Note 1: When enabling an interrupt source as a means of terminating a standby mode, always set the active state for the corresponding interrupt request. Note 2: When using an interrupt, always perform the following steps in order: (1) Enable the input for the interrupt if the corresponding pin is also used for a general-purpose port or any other purpose. (2) Set the active state for the interrupt during initialization. (3) Clear the interrupt request. (4) Enable the interrupt. Note 3: The TMP1942 has eight interrupt sources (INT0~INT4, INTRTC, INTB/INTC/INTD/INTE, and KWUP0-KWUPD) which can be used as a means of terminating a standby mode. For INT0 to INT4, use the CG block to specify whether they are used to terminate a standby mode and to specify their active edge or level. For INTB/INTC/INTD/INTE and KWUP0-KWUPD, use the CG block to specify whether they are used to terminate a standby mode and use INTBCDEST and KWUPSTn, respectively, to specify their active edge or level. Set the active state for the corresponding interrupt source to High in the INTC block. Example: Enable the INT0 interrupt IMCGA0 = "10" IMCGA0 = "1" IMC0L = "01" IMC0L = "101" CG block (Input is enabled on the falling edge.) INTC block (A High-level interrupt is active and the interrupt level is 5.)
All interrupt sources other than those which are used to terminate STOP/SLEEP mode are set in the INTC circuit block. Note 4: Among the above eight interrupt sources used to request the termination of a standby mode, INT0 to INT4 do not require settings in the CG block if they are used as normal interrupts. They still, however, require level or edge specification in the INTC. If INTB/INTC/INTD/INTE and KWUP0-KWUPD are used as normal interrupts, specify the active level or edge using INTBCDEST/KWUPSTn and specify the High level in the INTC. Settings in the CG are not required. INTRTC always requires settings in both the CG and INTC even if it is used as a normal interrupt. All interrupt sources other than those which are used to terminate a standby mode are set in the INTC circuit block.
TMP1942CY/CZ-24
TMP1942CY/CZ
(3) Interrupt request clear register 7
EICRCG Bit Symbol (0xFFFF_EE20) Read/Write After reset Function

6

5
4
3

2
ICRCG2
1
ICRCG1 W
0
ICRCG0
1
0
Clear interrupt request 000: INT0 100: INT4 001: INT1 101:KWUP 010: INT2 110: INTB/C/D/E 011: INT3 111: INTRTC
Note : To clear any of the eight interrupt sources which are used for terminating a standby mode: (1) For KWUP, use KWUPCLR. (2) For extended interrupts INTB/INTC/INTD/INTE, use INTFLG. (3) For INT0 to INT4 and INTRTC, perform the clearing operation twice, first in the CG block and then in the INTC block. (4) For all other interrupt sources, use the INTC block.
3.3.3
System clock control unit
When reset, the device enters single-clock mode with the result that XEN = 1, XTEN = 0 and GEAR1:0 = 11; the system clock fsys is set to fc/8 (= fc x 1/8). (Since the PLL multiplies the original oscillation frequency by 4, fc equals to fosc x 4, where fosc is the original oscillation frequency.) For example, if the X1 and X2 pins are connected to an 8-MHz resonator, a reset will set fsys to 4 MHz (= 8 MHz x 4 x 1/8). To disable the system from using a PLL-multiplied clock as the system clock by default, drive the PLLOFF pin Low. In this case, too, the system clock fsys will be set to fc/8 (= fc x 1/8) by a reset. However, since SYSCR1 is initialized to 0 by a reset (so that fc = fosc x 1/2), if the X1 and X2 pins are connected to a 25-MHz resonator, fsys will be 1.25 MHz. Also, if the device is clocked by an external oscillator and no internal resonator is connected, fc = fosc can be selected by setting SYSCR1 to 1 after a reset, so that the system clock frequency fsys is twice the frequency obtained with an internal resonator. (1) Oscillation settling time (switchover between NORMAL and SLOW modes) If a resonator is connected to the resonator-connecting pins, the device uses the built-in warm-up timer to check whether resonator oscillation has settled. The warm-up time can be set to suit the characteristics of the resonator using SYSCR2. The value of SYSCR0 must be checked in software (using instructions) to determine the start and completion of the warm-up time. Table 3.3.1 shows warm-up times for mode switching.
TMP1942CY/CZ-25
TMP1942CY/CZ
Note 1: Warm-up is unnecessary when the clock generator uses an oscillator so that its oscillation is stable. Note 2: Since the warm-up timer is clocked by an oscillating clock, it will not be exact if the oscillation frequency fluctuates. The warm-up time should, therefore, be considered to be an approximate value. Note 3: Before starting the warm-up timer, first confirm that the PLL lock-up flag is 0. Note 4: The following precautions must be observed when a low-speed oscillator is being used: When a low-speed oscillator is connected to ports PD6 and PD7, the corresponding register must be set as shown below in order to reduce the device's power consumption. (When using a resonator) Set PDCR to 11 and PD to 00. (When using an external clock) Set PDCR to 11 and PD to 10. Table 3.3.1 Warm-Up Time Warm-Up Time Selection SYSCR2
(2 /oscillation frequency) (2 /oscillation frequency) (2 /oscillation frequency) (2 /oscillation frequency)
16 14 8 2
High-Speed Clock (fosc)
0.5 [s] 32 [s] 2.048 [ms] 8.192 [ms]
Low-Speed Clock (fs)
122 [s] 7.8 [ms] 500 [ms] 2000 [ms]
The values calculated are for when fosc = 8 MHz and fs = 32.768 kHz.
Note: When returning from STOP/SLEEP mode to NORMAL or SLOW mode, set the warm-up time to 122 s or greater beforehand. Example: If the device will return from SLEEP mode to SLOW mode, set SYSCR2 to 00, that is, a warm-up time of 122 s, before entering SLEEP mode. (2) Outputting the system clock from a pin The system clock fsys or fs can be output from the P44/SCOUT pin to an external device. The P44/SCOUT pin can be set to function as the SCOUT pin by setting the registers which relate to port 4 as follows: P4CR = 1 and P4FC = 1. Use SYSCR3 to select which clock will be output from this pin. Table 3.3.2 shows the pin state for each standby mode when the P44/SCOUT pin is set to function as SCOUT. Table 3.3.2 SCOUT Output State for Each Standby Mode Mode
SCOUT Selection
= "0" = "1"
NORMAL, SLOW
Outputs fs clock. Outputs fsys clock.
Standby Mode IDLE SLEEP STOP
Fixed to 0 or 1
Note: This function does not guarantee a particular phase difference (AC timing) between the internal clock and the system clock output from SCOUT.
TMP1942CY/CZ-26
TMP1942CY/CZ
(3) Reducing the driving capability of oscillators If a resonator is connected to the resonator-connecting pins of an oscillator, this function can suppress oscillation noise output from the oscillator, while reducing power consumption by the oscillator. Setting SYSCR2 to 1 causes the driving capability of the high-speed oscillator to degrade (Weak). Similarly, setting SYSCR2 to 1 causes the driving capability of the low-speed oscillator to degrade (Weak). Because both bits are initialized to 0 upon a system reset, both oscillators start oscillating with their normal driving capability (Normal) when the power is turned on. The oscillators must be placed in the Normal state ( or = 0) when they start oscillating in any other cases, such as when STOP/SLEEP mode is terminated. 1) Reducing the driving capability of the high-speed oscillator
fOSC C1 Resonator SYSCR2 C2 X2 pin X1 pin Oscillation enable
2) Reducing the driving capability of the low-speed oscillator
C1 Resonator SYSCR2 C2 XT2 pin fS XT1 pin Oscillation enable
3.3.4
Prescaler clock control unit
The internal I/O blocks (TMRA01 to TMRAAB, TMRB0 to TMRBD, SIO0 to SIO5, SBI, and ADC) each incorporate a prescaler for dividing the clock frequency. The clock T0 fed into these prescalers is derived from the clock fperiph. fperiph is either fgear or fc (as specified by the value of SYSCR1) divided by either 4 or 2, or not divided (as specified by the value of SYSCR0. By default, fperiph is set to fgear and T0 to fperiph/4.
3.3.5
Clock multiplication circuit (PLL)
This circuit multiplies the high-speed oscillator output clock, fosc, by 4 and outputs the result as the clock fpll. This enables the oscillator to yield a fast internal clock with a low oscillator frequency. The PLL is halted by a reset. To use the PLL, hold the PLLOFF pin High when terminating a reset.
Note: If a reset is terminated while the PLLOFF pin is held Low, the PLL will not work and the internal clock chosen will be the original oscillating clock (i.e., it will not be multiplied by 4).
TMP1942CY/CZ-27
TMP1942CY/CZ
Since the PLL is configured as an analog circuit, it requires a certain settling time (a lock-up time) after it has been activated, as does the oscillator. The same timer is used for both warm-up and lock-up. The lock-up time must be set using SYSCR3 so that it satisfies the following relationship: Lock-up time warm-up time By default, the lock-up time is 216/input frequency. The lock-up timer is initiated as the high-speed oscillator starts warm-up, and the lock-up flag SYSCR3 remains 1 until the PLL is locked in phase and cleared to 0 upon the completion of lock-up. If, for example, the PLL gets out of lock in a standby mode and control which depends on the software's execution speed, such as real-time processing, is to be performed, the software must check the lock-up flag after operation has started (i.e., after warm-up has been completed) to ensure that the clock has settled, before it starts processing. On the other hand, various hardware settings and static processing, such as register and memory initialization, can be executed before the lock-up flag has been cleared. Note: The LUPFG bit is undefined when the PLLOFF pin is Low (the PLL is not used).
Precautions to be observed when switching clock gear: Clock gear switchover is performed by writing a value to SYSCR1. The clock gear is not switched immediately after the write: a execution time equal to several clock cycles is required. Therefore, one or more instructions following the clock gear switchover instruction may be executed using the old clock gear value. If these instructions need to be executed using the new clock gear value, insert a dummy instruction (which executes a write cycle only) after the clock gear switchover instruction. When using a clock gear, make sure that the prescaler output Tn in each peripheral I/O block satisfies the following relationship: Tn < fsys/2 For this purpose set the clock-related registers so that Tn is slower than fsys/2.
3.3.6
Standby control unit
If the Halt bit in the TX19 processor core's Config register is set in NORMAL mode, the device enters one of the standby modes - IDLE, SLEEP or STOP - as determined by the contents of SYSCR2. If the Config register's Doze bit is set, the device enters IDLE mode regardless of the setting of SYSCR2. Features of the IDLE, SLEEP and STOP modes are described below. 1) IDLE: In this mode, only the CPU stops. In the register corresponding to each module there is an IDLE mode run/stop setup bit for internal I/O. This allows each module to be set independently to run or stop while the device is in IDLE mode. Table 3.3.3 lists the IDLE setup registers available for each internal I/O module.
TMP1942CY/CZ-28
TMP1942CY/CZ
Table 3.3.3 IDLE Mode Internal I/O Setup Registers Internal I/O
TMRA01 TMRA23 TMRA45 TMRA67 TMRA89 TMRAAB TMRB0 TMRB1 TMRB2 TMRB3 TMRB4 TMRB5 TMRB6 TMRB7 TMRB8 TMRB9 TMRBA TMRBB TMRBC TMRBD SIO0 SIO1 SIO3 SIO4 SIO5 SBI A/D converter WDT
IDLE Mode Setup Register
TA01RUN TA23RUN TA45RUN TA67RUN TA89RUN TAABRUN TB0RUN TB1RUN TB2RUN TB3RUN TB4RUN TB5RUN TB6RUN TB7RUN TB8RUN TB9RUN TBARUN TBBRUN TBCRUN TBDRUN SC0MOD1 SC1MOD1 SC3MOD1 SC3MOD1 SC4MOD1 SBI0BR1 ADMOD1 WDMOD
Note 1: In Halt mode (entered when the Halt bit in the Config Register is set), the TX19 processor core stops processor operation while maintaining the pipeline status. Since it does not respond to requests for control of the bus from internal DMA, it retains control of the bus. Note 2: In Doze mode (entered when the Doze bit in the Config Register is set), the TX19 processor core stops processor operation while maintaining the pipeline status. In this mode, it can respond to requests for control of the bus from devices external to the processor core. 2) SLEEP: Only the internal low-speed oscillator, timer for real-time clock, 2-phase pulse input counter, and KWUP (dynamic pull-up) operate. 3) STOP: The CPU runs with the low-speed clock. The INTC, timer for real-time clock, WDT, 2-phase pulse input counter, KWUP (dynamic pull-up), PIO, and EBIF can operate. Operation of other peripheral functions is not guaranteed. 4) SLOW: All of the internal circuits stop.
TMP1942CY/CZ-29
TMP1942CY/CZ
(1) Operating status in each mode Table 3.3.4 Operating Status in Each Mode Operation Mode
NORMAL IDLE (Halt) IDLE (Doze) SLEEP STOP
Operating Status
The TX19 processor core and peripheral I/O both operate at the maximum frequency. The TX19 processor core, INTC, timer for real-time clock, WDT, 2-phase pulse input counter, KWUP (dynamic pull-up), PIO, and EBIF operate with the low-speed clock. Processor operation stops and peripheral I/O operates as specified. Processor operation stops. Only the internal low-speed oscillator, timer for real-time clock, 2-phase pulse input counter, and KWUP (dynamic pull-up) operate (fs). Processor and peripheral I/O operation stops completely.
(2) CG operation in each mode Table 3.3.5 CG Status in Each Operating Mode Clock Source
Resonator
Mode
NORMAL SLOW IDLE (Halt) IDLE (Doze) SLEEP STOP
Oscillator PLL
fs only
x x x x x x x
Clock Supply to Peripheral I/O Clock Supply to the CPU
Partially supplied (Note) Selectable Selectable Timer for real-time clock, 2-phase pulse input counter, and dynamic pull-up
x
x

x x x x

x x
External input
NORMAL SLOW IDLE (Halt) IDLE (Doze) SLEEP STOP
x
Partially supplied(Note) Selectable Selectable Timer for real-time clock, 2-phase pulse input counter, and dynamic pull-up
x

x x x x

x x
Note: This includes the INTC, EBIF (external bus interface), I/O ports, WDT, and timer for real-time clock. (3) Operation of circuit blocks in each mode (: Operating, x: Idle) Table 3.3.6 Circuit Block Operating Status in Each Mode Circuit Block
TX19 processor core DMAC INTC EBIF External bus right PIO DA ADC SIO I2C Timer counter WDT 2-phase pulse input counter Dynamic pull-up Timer for real-time clock CG Fsys/fs Fs fs
Clock Source IDLE (Doze)
x
IDLE (Halt)
x x
SLEEP
x x x x x x x (*1) x x
STOP
x x x x x x x (*1) x x x x x x x x x
fsys
x
Can be selected to run or stop for each module independently.
x x x
(fs only)
*1: DAC output is controlled with the OP bit for each channel.
TMP1942CY/CZ-30
TMP1942CY/CZ
(4) Terminating a standby mode The device can be freed from a standby mode by an interrupt request or a reset. The combination of the interrupt mask register setting and the current standby mode determines which interrupt source will be used to terminate the standby mode. The interrupt mask register is part of the Status register in the TX19 processor core's system control coprocessor (CP0). Details are given in Table 3.3.7. * Termination by an interrupt request The operation performed when the device is released from a standby mode by an interrupt request varies according to the interrupt enable status. If the interrupt level which was set before the device entered the standby mode is greater than or equal to the value in the interrupt mask register, the processor services the requested interrupt after exiting the standby mode and then begins executing instructions starting with the one following the instruction to enter the standby mode (i.e., the instruction which specified the appropriate Config register bit). If the interrupt request level is less than the value in the interrupt mask register, the processor immediately begins executing instructions starting with the one following the instruction to enter the standby mode (i.e., the instruction which specified the appropriate Config register bit) without servicing the requested interrupt. (The interrupt request flag remains 1.) Non-maskable interrupts are always serviced after standby mode has terminated, irrespective of the value of the mask register. * Termination by a reset The device can be released from any standby mode by a reset. However, after release from STOP mode, a certain reset time is required for oscillator operation to settle. The reset selects a warm-up time of 214/oscillation frequency. After release by a reset, the internal RAM data can be retained in the state in which it was placed immediately before the standby mode was entered; however, all other settings will be initialized. (After released by an interrupt, other settings are also retained in the state in which they were placed immediately before the standby mode was entered.) Table 3.3.7 Standby Termination Sources and Standby Termination Operation Interrupt Acceptance State Standby mode
NMI
Standby mode termination source
Interrupt Enabled Interrupt Enabled (Interrupt level) > (Interrupt mask) (Interrupt level) (Interrupt mask) IDLE SLEEP STOP (programmable)
*1
x x x x
IDLE SLEEP (programmable)
STOP
INTWDT INT0~4, INTB~E KWUP0~D
Interrupt
*1 *1
x x x x x x x x x


x x
*1 *1
x x x x x x x
INTRTC INT5~A INTTA0~B INTTB0~D INTRX0~5, TX0~5 INTS2 INTAD/ADHP/ADM
(*2)
x x x
(*2)
x x x
RESET
: After exiting the standby mode, the processor starts servicing the interrupt. (RESET initializes the LSI.) : After exiting the standby mode, the processor begins executing instructions starting with the one following the instruction to enter the standby mode, without servicing the interrupt.
TMP1942CY/CZ-31
TMP1942CY/CZ
x: Cannot be used to exit from a standby mode. *1: The device is actually released from the standby mode after the warm-up time has passed. *2: Only INTTB2 and INTTB3 can be used when 2-phase pulse input counter mode is selected. Note 1: When using a level-sensitive interrupt to terminate a standby mode, be sure to hold the level until the processor starts servicing the interrupt. If the level is changed before that time, the interrupt cannot be serviced properly. Note 2: If the interrupts are disabled in the CPU, use the interrupt controller (INTC) to disable only the interrupts other than those used for terminating standby, before placing the device in any of the standby modes. (5) STOP mode In STOP mode all internal circuits, including the internal oscillator, stop operating. The pin state in STOP mode varies according to the setting of SYSCR2, as shown in Table 3.3.10. Once released from STOP mode, the device waits for a while (until the warm-up time ends) before starting to output the system clock; the warm-up time is counted by the warm-up counter. This delay is to ensure that the internal oscillator settles properly. After exiting STOP mode the device starts operating according to the settings of SYSCRO, which select the operating mode (NORMAL mode or SLOW mode) to be entered on exit from STOP mode. These settings must be made before the instruction to enter standby mode is executed. The warm-up time is determined by the setting of SYSCR2. (6) Timing of terminating STOP/SLEEP mode 1) Operation mode transition from Normal through Stop to Normal
fsys (high-speed clock) Mode CG (high-speed clock) Warm-up (W-up) Warm-up started When fosc = 8 MHz W-up time selection SYSCR2 00(22/fosc) 01(28/fosc) 10(214/fosc) 16 11(2 /fosc) W-up time (fc) Not allowed Not allowed 2.048 ms 8.192 ms Warm-up finished Normal System clock stopped
Stop
Normal
High-speed clock oscillation started
Note: must not be set to 00 or 01 resuming time requirements for the internal system.
TMP1942CY/CZ-32
TMP1942CY/CZ
2) Operation mode transition from Normal through Sleep to Normal
fsys (high-speed clock) Mode CG (high-speed clock) CG (low-speed clock) Warm-up (W-up) Warm-up started When fosc = 8 MHz W-up time selection SYSCR2 2 01(2 /fosc) 01(28/fosc) 10(214/fosc) 11(216/fosc) Warm-up finished Low-speed clock (fs) continues oscillation. High-speed clock oscillation started Low-speed clock (fs) continues oscillation. Normal System clock stopped
Sleep
Normal
W-up time (fc) Not allowed Not allowed 2.048 ms 8.192 ms
Note: must not be set to 00 or 01 because those settings would not satisfy the resuming time requirements for the internal system.
3) Operation mode transition from Slow through Stop to Slow
fsys (low-speed clock) Mode CG (low-speed clock) Warm-up (W-up) Warm-up started When fs = 32.768 MHz W-up time selection SYSCR2 01(22/fosc) 01(28/fosc) 10(214/fosc) 16 11(2 /fosc) W-up time (fc) Not allowed 7.8 ms 500 ms 2000 ms Warm-up finished Slow System clock stopped
Stop
Slow
Low-speed clock oscillation started
4) Operation mode transition from Slow through Sleep to Slow
fsys (low-speed clock) Mode CG (low-speed clock) Warm-up (W-up) Warm-up started When fs = 32.768 MHz W-up time selection SYSCR2 01(22/fs) 01(28/fs) 10(214/fs) 11(216/fs) Warm-up finished Slow System clock stopped
Sleep
Slow
Low-speed clock continues oscillation.
W-up time (fc) 122 s 7.8 ms 500 ms 2000 ms
Note: fs continues oscillation but the warm-up time need be set. Set to 00.
TMP1942CY/CZ-33
TMP1942CY/CZ
Table 3.3.8 Pin States in STOP Mode (1/2)
Pins AD0~AD7 AD8~AD15 A0~A7/A16~A23 , RD WR WAIT, BUSRQ HWR , BUSAK , R / W P37 P40~43 P44 (SCOUT) P50~57 P60~67
P90~P91
P92~97 PA0~PA1
PA2~PA7 PA7
PB1~PB4
PB0,PB5~PB6 PB7
PC0~PC5,PC7 PC6
PD0~PD5 PD6 (XT1)~ PD7 (XT2)
Input/Output Input/Output Input/Output Output Output Input Output Output mode Input mode Output mode Input mode Output mode Input pin Input pin Input mode(KEY0~KEY7) Input mode Output mode Input mode(INT3,INT4) Input mode Output mode Input mode Output mode Input mode(INT3,INT4) Input mode Output mode Input mode Output mode Input mode(KEYA) Input mode Output mode Input mode(INTB~INTE) Input mode Output mode Input mode Output mode Input mode(KEYB) Input mode Output mode Input mode Output mode Input mode(KEYB) Input mode Output mode Input mode Output mode XT1, XT2
= 0 PU* PU* PU* PU* Input Input Input Input Input Input Input -
= 1 Output Output Input Output Input Output Input Output Input Input Output Input Input Output Input Output Input Input Output Input Output Input Input Output Input Input Output Input Output Input Input Output Input Output Input Input Output Input Output -
TMP1942CY/CZ-34
TMP1942CY/CZ
Pins PE0~PE5 PE6~PE7
PF0,PF2~PF5 PF1
PF6
NMI
ALE
RESET
BW0, BW1 X1 X2
Input/Output Input mode Output mode Input mode Output mode Input mode(INT1,INT2) Input mode Output mode Input mode Output mode Input mode(KEYD) Input mode Output mode Input mode(INT0) Input pin Output pin Input pin Input pin Input pin Output pin
= 0 Input Input Input Input Output Low Input Input Output High
= 1 Input Output Input Output Input Input Output Input Output Input Input Output Input Input Output Low Input Input Output High
-:
Pins configured for input mode and input-only pins are disabled. Pins configured for output mode and output-only pins assume the high-Impedance state.
Input: The input gate is active; the input voltage must be held at either the high or low level to keep the input pin from floating. Output: Pin direction is output. PU*: Programmable pull-up. Because the input gate is always disabled, no overlap current flows while in high-impedance state.
TMP1942CY/CZ-35
TMP1942CY/CZ
3.4
Interrupts
Interrupts are controlled by the Status and Status settings in the CP0 status register, as well as by the internal interrupt controller and the CG. For related information, refer to Section 5, "Exception Handling" in "TX19 Family Architecture". Interrupts in the TMP1942 have the following features: * * * * * * Interrupts from the CPU itself (software interrupt instructions): 4 sources External interrupt pins ( NMI , INT0-INTE, KWUP0-KWUPD): 30 sources Interrupts from internal I/O: 46 sources Vector generation for each interrupt source 7 interrupt priority levels for each source Can be used to activate the DMAC
TMP1942CY/CZ-36
TMP1942CY/CZ
CG INTnEN standby termination control Detection circuit INT04 5
8
Active High level INTC 8
High or Low level/edge setting
High level 8 High level
1 1
High level Core
7
Other interrupts Active High level KWUP High or Low level/edge setting
KEY0D
Disable/enable each key input RTC Active High level Extended interrupts High or Low level/edge setting Disable/enable input for each interrupt source Note 1: Note 2: Note 3: Note 4: Standby termination is performed via the CG detection circuit. Since its output is a High-level active signal, the INTC must be set to accept a High-level active signal. The CG is bypassed for any processing other than standby termination. In that case, the active conditions for INT0 to INT4 must be set in the INTC. INTRTC requires CG settings for both standby termination and other processing. The INTC must be set to accept a High-level active signal. KWUP and INTB to INTD require settings in each circuit block for both standby termination and other processing. The INTC must be set to accept a High-level active signal.
INTBE
Figure 3.44.1 Interrupt Connection Diagram
TMP1942CY/CZ-37
TMP1942CY/CZ
(1) External interrupts INT0 to INT4, INTB to INTE, KWUP0 to KWUPD, and INTRTC 1) INT0 to INT4 When used to terminate a standby mode, these interrupts must have their active state set (using IMCGxx) and must be enabled for input (using IMCGxx) in the CG block. Then the active state of each of the interrupt source must be set to High (by setting IMCxx to 01) in the INTC block. When these interrupts are not used to terminate a standby mode, set their active state in the INTC block. 2) INTB to INTE When used to terminate a standby mode, these interrupts must have their active state set to High (by setting IMCGB2<21:20> to 10) and must be enabled for input (by setting IMCGB2<16> to 1) in the CG block. Then the active state of each of the interrupt source must be set to High (by setting IMCxx to 01) in the INTC block. Use INTnST for each interrupt source to set the active state and enable or disable the interrupt. When these interrupts are not used to terminate a standby mode, make necessary settings in the INTC block and INTnST without having to make settings in the CG. 3) KWUP0 to KWUPD When used to terminate a standby mode, these interrupts must have their active state set to High (by setting IMCGB1<21:20> to 10) and must be enabled for input (by setting IMCGB1<16> to 1) in the CG block. Then the active state of each of the interrupt source must be set to High (by setting IMCxx to 01) in the INTC block. Use KWUPSTn for each interrupt source to set the active state and enable or disable the interrupt. When these interrupts are not used to terminate a standby mode, make necessary settings in the INTC block and KWUPSTn without having to make settings in the CG. 4) INTRTC Regardless of whether INTRTC is used to terminate a standby mode, this interrupt must have its active state set to a rising edge (by setting IMCGB3<29:28> to 11) and must be enabled for input (by setting IMCGB3<24> to 1) in the CG block. Then the active state of each of the interrupt source must be set to High (by setting IMCxx to 01) in the INTC block.
TMP1942CY/CZ-38
TMP1942CY/CZ
(2) External interrupts INT5 to INTA and internal interrupt signals (other than INTRTC) All these interrupts must be set in the INTC block. The INTC resolves priority conflicts between interrupt sources and notifies the TX19 processor core of the interrupt with the highest priority. Interrupt
INT0INT4, INTRTC*
Register to be Set
IMCGx reg.In CG IMCx reg.In INTC
Usable Interrupt Detection Level
When used to terminate a standby mode, the interrupt source active state must be set to High in the INTC block. The active state of these interrupts must be selected in the CG. However, when these interrupts are not used to terminate a standby mode, their active state must be selected in the INTC block. In both cases, Low level, High level, falling edge and rising edge are all acceptable. The interrupt source active state must always be set to High in the INTC block. When these interrupts are used to terminate a standby mode, the interrupt source active state must also be set to High in the CG. The active state of these interrupts must be selected in INTnST. However, when these interrupts are not used to terminate a standby mode, settings in the CG are not necessary. In both cases, Low level, High level, falling edge and rising edge are all acceptable. The interrupt source active state must always be set to High in the INTC block. When these interrupts are used to terminate a standby mode, the interrupt source active state must also be set to High in the CG. The active state of these interrupts must be selected in KWUPSTn. However, when these interrupts are not used to terminate a standby mode, settings in the CG are not necessary. In both cases, Low level, High level, falling edge and rising edge are all acceptable. Low level, High level, falling edge and rising edge are all acceptable in the INTC. Falling edge Rising edge
INTBINTE
IMCGx reg.In CG IMCx reg.In INTC INTnST
KWUP0D
IMCGx reg.In CG IMCx reg.In INTC KWUPSTn
INT5INTA Internal I/O INTDMAn Others
IMCx reg.In INTC IMCx reg.In INTC IMCx reg.In INTC
Note 1: Interrupt level 0 indicates that the corresponding interrupt is disabled. Note 2: Only a rising edge can be used for INTRTC. * Example interrupt settings When INT0 is used to request the termination of STOP/SLEEP mode (falling edge) a. Enabling the interrupt IMCGA0 = "10" EICRCG = "000" IMCGA0 = "1" IMC0L = "01" INTCLR = "000001" IMC0L = "101" Status = "1", = "xxx" b. Disabling the interrupt Status = "0" IMC0L = "000" INTCLR = "000001" IMCGA0 = "0" EICRCG = "000"
: Select falling edge for INT0 : Clear interrupt request for INT0 : Enable request input for INT0 : Select High level for INT0 : Clear interrupt request for INT0 : Set interrupt level to 5
CG block
INTC block TX19 processor core
TX19 processor core : Disable interrupt for INT0 : Clear interrupt request for INT0 : Disable request input for INT0 : Clear interrupt request for INT0 INTC block CG block
TMP1942CY/CZ-39
TMP1942CY/CZ 3.4.1 Interrupt sources
(1) Reset and non-maskable interrupts: RESET , NMI and INTWDT (watchdog timer interrupt) Vector address: 0xBFC0_0000 (virtual address) (2) Maskable interrupts: Software and hardware interrupts Vector addresses: 0xBFC0_0210 (virtual address) to 0xBFC0_0260 (virtual address) Interrupt Source
Reset Non-maskable Software
Maskable
Vector Address (virtual address)
0xBFC0_0000
Swi0 Swi1 Swi2 Swi3
0xBFC0_0210 0xBFC0_0220 0xBFC0_0230 0xBFC0_0240 0xBFC0_0260
Hardware
Note 1: When vector addresses are located in the on-chip ROM, set the BEV bit in the system control coprocessor (CP0) Status register to 1. Note 2: Maskable software interrupts are generated by setting in CP0 Cause register. Do not confuse these software interrupts with Software Set, which is one of the hardware interrupt sources. The Software Set interrupt is generated by setting in the interrupt controller (INTC) IMC0 register to any value other than 0.
TMP1942CY/CZ-40
TMP1942CY/CZ
Table 3.44.1 Hardware Interrupt Sources
Interrupt Number 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 IVR[9 : 0] 000 010 020 030 040 050 060 070 080 090 0A0 0B0 0C0 0D0 0E0 0F0 100 110 120 130 140 150 160 170 180 190 1A0 1B0 1C0 1D0 1E0 1F0 200 210 220 230 240 250 260 270 280 290 2A0 2B0 2C0 2D0 2E0 2F0 300 310 320 330 340 350 360 370 380 390 3A0 3B0 3C0 3D0 3E0 3F0 Interrupt Source Software Set INT0 pin (standby termination) INT1 pin (standby termination) INT2 pin (standby termination) INT3 pin (standby termination) INT4 pin (standby termination) KWUP (standby termination) INTB/C/D/E pin (standby termination) Reserved Reserved INT5 pin INT6 pin INT7 pin INT8 pin INT9 pin INTA pin INTRX0: Serial reception (channel 0) INTTX0: Serial transmission (channel 0) INTRX1: Serial reception (channel 1) INTTX1: Serial transmission (channel 1) INTS2: Serial channel 2 interrupt INTRX3: Serial reception (channel 3) INTTX3: Serial transmission (channel 3) INTADHP: Highest-priority A/D conversion completed INTADM: A/D conversion monitor interrupt INTTA0: 8-bit timer 0 INTTA1: 8-bit timer 1 INTTA2: 8-bit timer 2 INTTA3: 8-bit timer 3 INTTB0: 16-bit timer 0 INTTB1: 16-bit timer 1 INTRX4: Serial reception (channel 4) INTTX4: Serial transmission (channel 4) INTRX5: Serial reception (channel 5) INTTX5: Serial transmission (channel 5) Reserved Reserved INTTA4: 8-bit timer 4 INTTA5: 8-bit timer 5 INTTA6: 8-bit timer 6 INTTA7: 8-bit timer 7 INTTA8: 8-bit timer 8 INTTA9: 8-bit timer 9 INTTAA: 8-bit timer A INTTAB: 8-bit timer B INTTBA: 16-bit timer A INTTBB: 16-bit timer B INTTBC: 16-bit timer C INTTBD: 16-bit timer D INTTB2: 16-bit timer 2 INTTB3: 16-bit timer 3 INTTB4: 16-bit timer 4 INTTB5: 16-bit timer 5 INTTB6: 16-bit timer 6 INTTB7: 16-bit timer 7 INTTB8: 16-bit timer 8 INTTB9: 16-bit timer 9 Reserved INTRTC: Interrupt from timer for real-time clock INTAD: A/D conversion completed INTDMA0: DMA transfer completed (channel 0) INTDMA1: DMA transfer completed (channel 1) INTDMA2: DMA transfer completed (channel 2) INTDMA3: DMA transfer completed (channel 3) Interrupt control register IMC0L IMC0H IMC1L IMC1H IMC2L IMC2H IMC3L IMC3H IMC4L IMC4H IMC5L IMC5H IMC6L IMC6H IMC7L IMC7H IMC8L IMC8H IMC9L IMC9H IMCAL IMCAH IMCBL IMCBH IMCCL IMCCH IMCDL IMCDH IMCEL IMCEH IMCFL IMCFH Address 0xFFFF_E000 0xFFFF_E002 0xFFFF_E004 0xFFFF_E006 0xFFFF_E008 0xFFFF_E00A 0xFFFF_E00C 0xFFFF_E00E 0xFFFF_E010 0xFFFF_E012 0xFFFF_E014 0xFFFF_E016 0xFFFF_E018 0xFFFF_E01A 0xFFFF_E01C 0xFFFF_E01E 0xFFFF_E020 0xFFFF_E022 0xFFFF_E024 0xFFFF_E026 0xFFFF_E028 0xFFFF_E02A 0xFFFF_E02C 0xFFFF_E02E 0xFFFF_E030 0xFFFF_E032 0xFFFF_E034 0xFFFF_E036 0xFFFF_E038 0xFFFF_E03A 0xFFFF_E03C 0xFFFF_E03E
TMP1942CY/CZ-41
TMP1942CY/CZ 3.4.2 Interrupt detection
When using interrupts to terminate a standby mode, the following settings are necessary according to the interrupt type: Interrupts INT0 to INT4 have their active state set using the EMCGxx field in the CG's internal IMCGxx register, then the EIMxx field in the INTC's internal IMCx register is set to High. Extended interrupts INTB to INTE have their active state set to High using the EMCG field in the CG's internal IMCGB2 register, then the EIMxx field in the INTC's internal IMCx register is set to High. In addition, INTnST is used to set the active state for each interrupt source and enable/disable the interrupt source. KWUP0 to KWUPD have their active state set to High using the EMCG field in the CG's internal IMCGB1 register, then the EIMxx field in the INTC's internal IMCx register is set to High. In addition, KWUPSTn is used to set the active state for each interrupt source and enable/disable the interrupt source. The RTC interrupt has its active state set to a rising edge using the EMCGxx field in the CG's internal IMCGxx register, then the EIMxx field in the INTC's internal IMCx register is set to High. Other interrupts have their active state set using only the EIMxx field in the INTC's internal IMCx register. The active state can be one of the following four: rising edge, falling edge, High level or Low level. When the TMP1942 detection circuit recognizes the active state of an interrupt request set in this way, it notifies the processor core or the INTC of the interrupt request. When the above interrupts are not used to terminate a standby mode, settings in the CG are not required: INT0 to INT4 require only settings in the INTC, INTB to INTE require the same settings in the INTC as for standby termination as well as setting in INTnST, and KWUP0 to KWUPD require the same settings in the INTC as for standby termination as well as setting in KWUPSTn. Cancellation of interrupt signals is carried out by the interrupt handler after it has recognized the requested interrupt. INTB to INTE are canceled by reading INTFLG. Interrupt signals from INT0 to INT4 and INTRTC are cancelled by writing the appropriate value to the ICRCG field in the CG's internal EICRCG register and then writing the corresponding value to the EICLR field in the INTC's internal INTCLR register. KWUP0 to KWUPD are canceled by setting KWUPCLR. Other interrupt signals are canceled by writing the appropriate value to the EICLR field in the INTC's internal INTCLR register. These cancellation procedures apply regardless of whether the active state is an edge or level.
TMP1942CY/CZ-42
TMP1942CY/CZ
Start NO Standby termination INTBE KWUP0D YES INT04 INTRTC Interrupt? INTBE KWUP0D
Interrupt? INT0A/ INTRTC* Set INTC
Set CG Set KWUPSTn or INTnST
Set INTC (High level)
Set INTC (High level) Set KWUPSTn or INTnST
Set CG (High level)
Set INTC (High level)
End
*
The INTRTC interrupt must have its active state set to a rising edge in the CG even when it is not used for standby termination. Figure 3.44.2 Flow for Setting External Interrupts Note: Each stage must be completed in the following sequence: set the active level, clear the interrupt request, and then enable the interrupt.
(Example of setting INT0 for standby termination) IMCGA0 = "10" : Select falling edge for INT0 EICRCG = "000" : Clear interrupt request for INT0C G block IMCGA0 = "1" : Enable request input for INT0 IMC0L = "01" : Select High level for INT0 INTCLR = "000001" : Clear interrupt request for INT0 INTC block IMC0L = "101" : Set interrupt level to 5 Status = "1", = "xxx" TX19 processor core
TMP1942CY/CZ-43
TMP1942CY/CZ 3.4.3 Resolving interrupt priority
(1) Seven interrupt priority levels The TMP1942 has seven interrupt priority levels; thus for each interrupt source the priority can be set to one of seven levels. The interrupt mode control register (IMCx) is used for setting interrupt levels. This register includes a 3-bit level-setting field (ILx). The greater the value (interrupt level) set in IMC, the higher the interrupt priority. If the value set for an interrupt source in this field is 000 (i.e., the interrupt level is set to 0), no interrupt is generated for that interrupt source. (2) Notification of the interrupt level When an interrupt occurs, the INTC notifies the TX19 processor core of the priority level of the interrupt. The TX19 processor core recognizes the interrupt level by reading the IL field in the Cause register. If multiple interrupts (with different priority levels) occur simultaneously, the TX19 processor core is notified of the interrupt with the highest priority. (3) Interrupt vector (notification of interrupt source) When an interrupt occurs, the INTC also sets the vector for the source of the generated interrupt in the vector register (IVR). The TX19 processor core reads the vector register to determine the interrupt source. If multiple interrupts (with the same priority level) occur simultaneously, the TX19 processor core is notified of the vector for the interrupt source with the smallest request number. When there are no interrupt sources for which an interrupt has occurred, the IVR[9:4] field is 0. When it is time for the TX19 processor core to read the vector register value, the INTC notifies the processor core. The processor core sets the Status bit with the interrupt level which it reads.
TMP1942CY/CZ-44
TMP1942CY/CZ 3.4.4 INTC registers
Table 3.44.2 INTC Register Map Address
0xFFFF_E060 0xFFFF_E040 0xFFFF_E03C 0xFFFF_E038 0xFFFF_E034 0xFFFF_E030 0xFFFF_E02C 0xFFFF_E028 0xFFFF_E024 0xFFFF_E020 0xFFFF_E01C 0xFFFF_E018 0xFFFF_E014 0xFFFF_E010 0xFFFF_E00C 0xFFFF_E008 0xFFFF_E004 0xFFFF_E000
Register Symbol
INTCLR IVR IMCF IMCE IMCD IMCC IMCB IMCA IMC9 IMC8 IMC7 IMC6 IMC5 IMC4 IMC3 IMC2 IMC1 IMC0
Register
Interrupt request clear control Interrupt vector register Interrupt mode control register F Interrupt mode control register E Interrupt mode control register D Interrupt mode control register C Interrupt mode control register B Interrupt mode control register A Interrupt mode control register 9 Interrupt mode control register 8 Interrupt mode control register 7 Interrupt mode control register 6 Interrupt mode control register 5 Interrupt mode control register 4 Interrupt mode control register 3 Interrupt mode control register 2 Interrupt mode control register 1 Interrupt mode control register 0
Corresponding Interrupt Number
ALL (63 - 0) ALL (63 - 0) 63 - 60 59 - 56 55 - 52 51 - 48 47 - 44 43 - 40 39 - 36 35 - 32 31 - 28 27 - 24 23 - 20 19 - 16 15 - 12 11 - 8 7-4 3-0
Interrupt vector register (IVR): Indicates the vector for the source of each interrupt generated. 7
IVR Bit Symbol After reset Function IVR7 0 (0xFFFF_E040) Read/Write 0 0 0 Indicates the vectors for generated interrupt sources.
6
IVR6
5
IVR5
4
IVR4 R
3
2
1
0
0
0
0
0
15
Bit Symbol Read/Write After reset Function 0
14
13
R/W
12
11
10
9
IVR9 R
8
IVR8 0
0
0
0
0
0
0
Indicates the vectors for generated interrupt sources.
23
Bit Symbol Read/Write After reset Function 0
22
21
20
R/W
19
18
17
16
0
0
0
0
0
0
0
31
Bit Symbol Read/Write After reset Function 0
30
29
28
R/W
27
26
25
24
0
0
0
0
0
0
0
TMP1942CY/CZ-45
TMP1942CY/CZ
Interrupt mode control registers: Set the priority level and active state for each interrupt source and set whether the interrupt is to be used to activate the DMAC. 7
IMC0 Bit Symbol After reset Function (0xFFFF_E000) Read/Write 0 0 0 Sets whether or not to activate the DMAC.
0: Not set.
6
5
EIM01
4
EIM00
3
DM0 R/W
2
IL02 0
1
IL01 0
0
IL00 0
Sets the active state of the interrupt request. 00: Low level Other settings are not allowed.
Sets the priority level for interrupt number 0 (Software Set) when DM0 = 0. 000: Disable interrupt. 001-111: 1 to 7 Selects a DMAC channel when
1: Set interrupt DM0 = 1. number 0 to 000-011: 0 to 3 activate the DMAC. 100-111: Invalid settings
15
Bit Symbol Read/Write After reset Function
14
13
EIM11 0
12
EIM10 0
11
DM1 R/W 0 Sets whether or not to activate the DMAC.
0: Not set.
10
IL12 0
9
IL11 0
8
IL10 0
Sets the active state of the interrupt request. 00: Low level 01: High level 10: Falling edge 11: Rising edge
Sets the priority level for interrupt number 1 (INT0) when DM1 = 0. 000: Disable interrupt.
001-111: 1 to 7 Selects a DMAC channel when 1: Set interrupt DM1 = 1.
number 1 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
23
Bit Symbol Read/Write After reset Function
22
21
EIM21 0
20
EIM20 0
19
DM2 R/W 0 Sets whether or not to activate the DMAC.
0: Not set.
18
IL22 0
17
IL21 0
16
IL20 0
Sets the active state of the interrupt request. 00: Low level 01: High level 10: Falling edge 11: Rising edge
Sets the priority level for interrupt number 2 (INT1) when DM2 = 0. 000: Disable interrupt. 001-111: 1 to 7 Selects a DMAC channel when
1: Set interrupt DM2 = 1. number 2 to 000-011: 0 to 3 activate the DMAC. 100-111: Invalid settings
31
Bit Symbol Read/Write After reset Function
30
29
EIM31 0
28
EIM30 0
27
DM3 R/W 0 Sets whether or not to activate the DMAC.
26
IL32 0
25
IL31 0
24
IL30 0
Sets the active state of the interrupt request. 00: Low level 01: High level 10: Falling edge 11: Rising edge
Sets the priority level for interrupt number 3 (INT2) when
DM3 = 0. 000: Disable interrupt. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set interrupt DM3 = 1. number 3 to 000-011: 0 to 3 activate the DMAC. 100-111: Invalid settings
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-46
TMP1942CY/CZ
7
IMC1 (0xFFFF_E004) Bit Symbol Read/Write After reset Function
6
5
EIM41
4
EIM40
3
DM4 R/W
2
IL42
1
IL41
0
IL40
0 0 Sets the active state of the interrupt request. 00: Low level 01: High level 10: Falling edge 11: Rising edge
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 4 (INT3) when not to DM4 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DM4 = 1. interrupt 000-011: 0 to 3 number 4 to 100-111: Invalid settings activate the DMAC.
15
Bit Symbol Read/Write After reset Function
14
13
EIM51
12
EIM50
11
DM5 R/W 0
10
IL52
9
IL51
8
IL50
0 0 Sets the active state of the interrupt request. 00: Low level 01: High level 10: Falling edge 11: Rising edge
0 0 0 Sets Sets the priority level for interrupt whether or number 5 (INT4) when not to DM5 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM5 = 1. interrupt 000-011: 0 to 3
number 5 to activate the DMAC.
100-111: Invalid settings
23
Bit Symbol Read/Write After reset Function
22
21
EIM61
20
EIM60
19
DM6 R/W 0
18
IL62
17
IL61
16
IL60
0 0 Sets the active state of the interrupt request. 00: Low level 01: High level 10: Falling edge 11: Rising edge
0 0 0 Sets Sets the priority level for interrupt whether or number 6 (KWUP) when not to DM6 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM6 = 1.
interrupt number 6 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
31
Bit Symbol Read/Write After reset Function
30
29
EIM71
28
EIM70
27
DM7 R/W 0
26
IL72
25
IL71
24
IL70
0
0 0 Sets the active state of the interrupt request. 00: Low level 01: High level 10: Falling edge 11: Rising edge
0 0 0 Sets Sets the priority level for interrupt whether or number 7 (INTB/C/D/E) when not to DM7 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM7 = 1. interrupt 000-011: 0 to 3 number 7 to 100-111: Invalid settings activate the
DMAC.
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-47
TMP1942CY/CZ
7
IMC2 (0xFFFF_E008) Bit Symbol Read/Write After reset Function
6
5
EIM81 0
4
EIM80 0
3
DM8 R/W 0 Must be set to 0.
2
IL82 0
1
IL81 0
0
IL80 0
Must be set to 00.
Must be set to 000.
15
Bit Symbol Read/Write After reset Function
14
13
EIM91 0
12
EIM90 0
11
DM9 R/W 0 Must be set to 0.
10
IL92 0
9
IL91 0
8
IL90 0
Must be set to 00.
Must be set to 000.
23
Bit Symbol Read/Write After reset Function
22
21
EIMA1
20
EIMA0
19
DMA R/W
18
ILA2
17
ILA1
16
ILA0
0 0 Sets the active state of the interrupt request. 00: Low level 01: High level 10: Falling edge 11: Rising edge
0 0 0 0 Sets Sets the priority level for interrupt whether or number 10 (INT5) when not to DMA = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DMA = 1.
interrupt number 10 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
31
Bit Symbol Read/Write After reset Function
30
29
EIMB1
28
EIMB0
27
DMB R/W
26
ILB2
25
ILB1
24
ILB0
0
0 0 Sets the active state of the interrupt request. 00: Low level 01: High level 10: Falling edge 11: Rising edge
0 0 0 0 Sets Sets the priority level for interrupt whether or number 11 (INT6) when not to DMB = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DMB = 1. interrupt 000-011: 0 to 3 number 11 100-111: Invalid settings to activate
the DMAC.
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-48
TMP1942CY/CZ
7
IMC3 (0xFFFF_E00C) Bit Symbol Read/Write After reset Function
6
5
EIMC1
4
EIMC0
3
DMC R/W
2
ILC2
1
ILC1
0
ILC0
0 0 Sets the active state of the interrupt request. 00: Low level 01: High level 10: Falling edge 11: Rising edge
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 12 (INT7) when not to DMC = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DMC = 1. interrupt 000-011: 0 to 3 number 12 100-111: Invalid settings to activate the DMAC.
15
Bit Symbol Read/Write After reset Function
14
13
EIMD1
12
EIMD0
11
DMD R/W 0
10
ILD2
9
ILD1
8
ILD0
0 0 Sets the active state of the interrupt request. 00: Low level 01: High level 10: Falling edge 11: Rising edge
0 0 0 Sets Sets the priority level for interrupt whether or number 13 (INT8) when not to DMD = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DMD = 1. interrupt 000-011: 0 to 3
number 13 to activate the DMAC.
100-111: Invalid settings
23
Bit Symbol Read/Write After reset Function
22
21
EIME1
20
EIME0
19
DME R/W
18
ILE2
17
ILE1
16
ILE0
0 0 Sets the active state of the interrupt request. 00: Low level 01: High level 10: Falling edge 11: Rising edge
0 0 0 0 Sets Sets the priority level for interrupt whether or number 14 (INT9) when not to DME = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DME = 1.
interrupt number 14 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
31
Bit Symbol Read/Write After reset Function
30
29
EIMF1
28
EIMF0
27
DMF R/W
26
ILF2
25
ILF1
24
ILF0
0
0 0 Sets the active state of the interrupt request. 00: Low level 01: High level 10: Falling edge 11: Rising edge
0 0 0 0 Sets Sets the priority level for interrupt whether or number 15 (INTA) when not to DMF = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DMF = 1. interrupt 000-011: 0 to 3 number 15 100-111: Invalid settings to activate
the DMAC.
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-49
TMP1942CY/CZ
7
IMC4 (0xFFFF_E010) Bit Symbol Read/Write After reset Function
6
5
EIM101 0
4
EIM100 0
3
DM10 R/W
2
IL102
1
IL101
0
IL100
Must be set to 11.
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 16 (INTRX0) when not to DM10 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DM10 = 1. interrupt 000-011: 0 to 3 number 16 100-111: Invalid settings to activate the DMAC.
15
Bit Symbol Read/Write After reset Function
14
13
EIM111 0
12
EIM110 0
11
DM11 R/W 0
10
IL112
9
IL111
8
IL110
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 16 (INTTX0) when not to DM11 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM11 = 1. interrupt 000-011: 0 to 3
number 17 to activate the DMAC.
100-111: Invalid settings
23
Bit Symbol Read/Write After reset Function
22
21
EIM121 0
20
EIM120 0
19
DM12 R/W
18
IL122
17
IL121
16
IL120
Must be set to 11.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 18 (INTRX1) when not to DM12 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM12 = 1.
interrupt number 18 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
31
Bit Symbol Read/Write After reset Function
30
29
EIM131
28
EIM130 0
27
DM13 R/W
26
IL132
25
IL131
24
IL130
0
0
Must be set to 11.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 19 (INTTX1) when not to DM13 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM13 = 1. interrupt 000-011: 0 to 3 number 19 100-111: Invalid settings to activate
the DMAC.
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-50
TMP1942CY/CZ
7
IMC5 (0xFFFF_E014) Bit Symbol Read/Write After reset Function
6
5
EIM141 0
4
EIM140 0
3
DM14 R/W
2
IL142
1
IL141
0
IL140
Must be set to 11.
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 20 (INTS2) when not to DM14 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DM14 = 1. interrupt 000-011: 0 to 3 number 20 100-111: Invalid settings to activate the DMAC.
15
Bit Symbol Read/Write After reset Function
14
13
EIM151 0
12
EIM150 0
11
DM15 R/W
10
IL152
9
IL151
8
IL150
Must be set to 11.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 21 (INTRX3) when not to DM15 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM15 = 1.
interrupt number 21 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
23
Bit Symbol Read/Write After reset Function
22
21
EIM161 0
20
EIM160 0
19
DM16 R/W 0
18
IL162
17
IL161
16
IL160
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 22 (INTTX3) when not to DM16 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM16 = 1. interrupt 000-011: 0 to 3 number 22 100-111: Invalid settings to activate
the DMAC.
31
Bit Symbol Read/Write After reset Function
30
29
EIM171
28
EIM170 0
27
DM17 R/W 0
26
IL172
25
IL171
24
IL170
0
0
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 23 (INTADHP) when not to DM17 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM17 = 1. interrupt 000-011: 0 to 3 number 23 100-111: Invalid settings to activate
the DMAC.
Note :
Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-51
TMP1942CY/CZ
7
IMC6 (0xFFFF_E018) Bit Symbol Read/Write After reset Function 0 0 Must be set to 11.
6
5
EIM181
4
EIM180
3
DM18 R/W
2
IL182
1
IL181
0
IL180
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 24 (INTADM) when not to DM18 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DM18 = 1. interrupt 000-011: 0 to 3 number 24 100-111: Invalid settings to activate the DMAC.
15
Bit Symbol Read/Write After reset Function
14
13
EIM191 0
12
EIM190 0
11
DM19 R/W 0
10
IL192
9
IL191
8
IL190
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 25 (INTTA0) when not to DM19 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM19 = 1.
interrupt number 25 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
23
Bit Symbol Read/Write After reset Function
22
21
EIM1A1 0
20
EIM1A0 0
19
DM1A R/W 0
18
IL1A2
17
IL1A1
16
IL1A0
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 26 (INTTA1) when not to DM1A = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM1A = 1. interrupt 000-011: 0 to 3 number 26 100-111: Invalid settings to activate
the DMAC.
31
Bit Symbol Read/Write After reset Function
30
29
EIM1B1
28
EIM1B0 0
27
DM1B R/W
26
IL1B2
25
IL1B1
24
IL1B0
0
0
Must be set to 11.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 27 (INTTA2) when not to DM1B = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM1B = 1. interrupt 000-011: 0 to 3 number 27 100-111: Invalid settings to activate
the DMAC.
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-52
TMP1942CY/CZ
7
IMC7 (0xFFFF_E01C) Bit Symbol Read/Write After reset Function 0 0 Must be set to 11.
6
5
EIM1C1
4
EIM1C0
3
DM1C R/W
2
IL1C2
1
IL1C1
0
IL1C0
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 28 (INTTA3) when not to DM1C = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DM1C = 1. interrupt 000-011: 0 to 3 number 28 100-111: Invalid settings to activate the DMAC.
15
Bit Symbol Read/Write After reset Function
14
13
EIM1D1 0
12
EIM1D0 0
11
DM1D R/W 0
10
IL1D2
9
IL1D1
8
IL1D0
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 29 (INTTB0) when not to DM1D = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM1D = 1.
interrupt number 29 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
23
Bit Symbol Read/Write After reset Function
22
21
EIM1E1 0
20
EIM1E0 0
19
DM1E R/W 0
18
IL1E2
17
IL1E1
16
IL1E0
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 30 (INTTB1) when not to DM1E = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM1E = 1. interrupt 000-011: 0 to 3 number 30 100-111: Invalid settings to activate
the DMAC.
31
Bit Symbol Read/Write After reset Function
30
29
EIM1F1
28
EIM1F0 0
27
DM1F R/W
26
IL1F2
25
IL1F1
24
IL1F0
0
0
Must be set to 11.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 31 (INTRX4) when not to DM1F = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM1F = 1. interrupt 000-011: 0 to 3 number 31 100-111: Invalid settings to activate
the DMAC.
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-53
TMP1942CY/CZ
7
IMC8 (0xFFFF_E020) Bit Symbol Read/Write After reset Function
6
5
EIM201 0
4
EIM200 0
3
DM20 R/W
2
IL202
1
IL201
0
IL200
Must be set to 11.
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 32 (INTTX4) when not to DM20 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DM20 = 1. interrupt 000-011: 0 to 3 number 32 100-111: Invalid settings to activate the DMAC.
15
Bit Symbol Read/Write After reset Function
14
13
EIM211 0
12
EIM210 0
11
DM21 R/W
10
IL212
9
IL211
8
IL210
Must be set to 11.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 33 (INTRX5) when not to DM21 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM21 = 1.
interrupt number 33 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
23
Bit Symbol Read/Write After reset Function
22
21
EIM221 0
20
EIM220 0
19
DM22 R/W 0
18
IL222
17
IL221
16
IL220
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 34 (INTTX5) when not to DM22 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM22 = 1. interrupt 000-011: 0 to 3 number 34 100-111: Invalid settings to activate
the DMAC.
31
Bit Symbol Read/Write After reset Function
30
29
EIM231
28
EIM230 0
27
DM23 R/W 0 Must be set to 0.
26
IL232 0
25
IL231 0
24
IL230 0
0
0
Must be set to 00.
Must be set to 000.
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-54
TMP1942CY/CZ
7
IMC9 (0xFFFF_E024) Bit Symbol Read/Write After reset Function 0 0 0 Must be set to 0. Must be set to 00.
6
5
EIM241
4
EIM240
3
DM24 R/W
2
IL242 0
1
IL241 0
0
IL240 0
Must be set to 000.
15
Bit Symbol Read/Write After reset Function
14
13
EIM251 0
12
EIM250 0
11
DM25 R/W
10
IL252
9
IL251
8
IL250
Must be set to 11.
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 37 (INTTA4) when not to DM25 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DM25 = 1. interrupt 000-011: 0 to 3 number 37 100-111: Invalid settings to activate the DMAC.
23
Bit Symbol Read/Write After reset Function
22
21
EIM261 0
20
EIM260 0
19
DM26 R/W
18
IL262
17
IL261
16
IL260
Must be set to 11.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 38 (INTTA5) when not to DM26 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM26 = 1.
interrupt number 38 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
31
Bit Symbol Read/Write After reset Function
30
29
EIM271
28
EIM270 0
27
DM27 R/W 0
26
IL272
25
IL271
24
IL270
0
0
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 39 (INTTA6) when not to DM27 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM27 = 1.
interrupt number 39 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-55
TMP1942CY/CZ
7
IMCA (0xFFFF_E028) Bit Symbol Read/Write After reset Function 0 0 Must be set to 11.
6
5
EIM281
4
EIM280
3
DM28 R/W
2
IL282
1
IL281
0
IL280
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 40 (INTTA7) when not to DM28 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DM28 = 1. interrupt 000-011: 0 to 3 number 40 100-111: Invalid settings to activate the DMAC.
15
Bit Symbol Read/Write After reset Function
14
13
EIM291 0
12
EIM290 0
11
DM29 R/W 0
10
IL292
9
IL291
8
IL290
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 41 (INTTA8) when not to DM29 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM29 = 1.
interrupt number 41 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
23
Bit Symbol Read/Write After reset Function
22
21
EIM2A1 0
20
EIM2A0 0
19
DM2A R/W 0
18
IL2A2
17
IL2A1
16
IL2A0
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 42 (INTTA9) when not to DM2A = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM2A = 1. interrupt 000-011: 0 to 3 number 42 100-111: Invalid settings to activate
the DMAC.
31
Bit Symbol Read/Write After reset Function
30
29
EIM2B1
28
EIM2B0 0
27
DM2B R/W
26
IL2B2
25
IL2B1
24
IL2B0
0
0
Must be set to 11.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 43 (INTTAA) when not to DM2B = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM2B = 1. interrupt 000-011: 0 to 3 number 43 100-111: Invalid settings to activate
the DMAC.
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-56
TMP1942CY/CZ
7
IMCB (0xFFFF_E02C) Bit Symbol Read/Write After reset Function 0 0 Must be set to 11.
6
5
EIM2C1
4
EIM2C0
3
DM2C R/W
2
IL2C2
1
IL2C1
0
IL2C0
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 44 (INTTAB) when not to DM2C = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DM2C = 1. interrupt 000-011: 0 to 3 number 44 100-111: Invalid settings to activate the DMAC.
15
Bit Symbol Read/Write After reset Function
14
13
EIM2D1 0
12
EIM2D0 0
11
DM2D R/W 0
10
IL2D2
9
IL2D1
8
IL2D0
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 45 (INTTBA) when not to DM2D = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM2D = 1.
interrupt number 45 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
23
Bit Symbol Read/Write After reset Function
22
21
EIM2E1 0
20
EIM2E0 0
19
DM2E R/W 0
18
IL2E2
17
IL2E1
16
IL2E0
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 46 (INTTBB) when not to DM2E = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM2E = 1. interrupt 000-011: 0 to 3 number 46 100-111: Invalid settings to activate
the DMAC.
31
Bit Symbol Read/Write After reset Function
30
29
EIM2F1
28
EIM2F0 0
27
DM2F R/W
26
IL2F2
25
IL2F1
24
IL2F0
0
0
Must be set to 11.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 47 (INTTBC) when not to DM2F = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM2F = 1. interrupt 000-011: 0 to 3 number 47 100-111: Invalid settings to activate
the DMAC.
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-57
TMP1942CY/CZ
7
IMCC (0xFFFF_E030) Bit Symbol Read/Write After reset Function 0 0 Must be set to 11.
6
5
EIM301
4
EIM300
3
DM30 R/W
2
IL302
1
IL301
0
IL300
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 48 (INTTBD) when not to DM30 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DM30 = 1. interrupt 000-011: 0 to 3 number 48 100-111: Invalid settings to activate the DMAC.
15
Bit Symbol Read/Write After reset Function
14
13
EIM311 0
12
EIM310 0
11
DM31 R/W 0
10
IL312
9
IL311
8
IL310
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 49 (INTTB2) when not to DM31 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM31 = 1.
interrupt number 49 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
23
Bit Symbol Read/Write After reset Function
22
21
EIM321 0
20
EIM320 0
19
DM32 R/W 0
18
IL322
17
IL321
16
IL320
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 50 (INTTB3) when not to DM32 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM32 = 1. interrupt 000-011: 0 to 3 number 50 100-111: Invalid settings to activate
the DMAC.
31
Bit Symbol Read/Write After reset Function
30
29
EIM331
28
EIM330 0
27
DM33 R/W
26
IL332
25
IL331
24
IL330
0
0
Must be set to 11.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 51 (INTTB4) when not to DM33 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM33 = 1. interrupt 000-011: 0 to 3 number 51 100-111: Invalid settings to activate
the DMAC.
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-58
TMP1942CY/CZ
7
IMCD (0xFFFF_E034) Bit Symbol Read/Write After reset Function
6
5
EIM341 0
4
EIM340 0
3
DM34 R/W
2
IL342
1
IL341
0
IL340
Must be set to 11.
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 52 (INTTB5) when not to DM34 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DM34 = 1. interrupt 000-011: 0 to 3 number 52 100-111: Invalid settings to activate the DMAC.
15
Bit Symbol Read/Write After reset Function
14
13
EIM351 0
12
EIM350 0
11
DM35 R/W
10
IL352
9
IL351
8
IL350
Must be set to 11.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 53 (INTTB6) when not to DM35 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM35 = 1.
interrupt number 53 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
23
Bit Symbol Read/Write After reset Function
22
21
EIM361 0
20
EIM360 0
19
DM36 R/W 0
18
IL362
17
IL361
16
IL360
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 54 (INTTB7) when not to DM36 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM36 = 1. interrupt 000-011: 0 to 3 number 54 100-111: Invalid settings to activate
the DMAC.
31
Bit Symbol Read/Write After reset Function
30
29
EIM371
28
EIM370 0
27
DM37 R/W 0
26
IL372
25
IL371
24
IL370
0
0
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 55 (INTTB8) when not to DM37 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM37 = 1. interrupt 000-011: 0 to 3 number 55 100-111: Invalid settings to activate
the DMAC.
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-59
TMP1942CY/CZ
7
IMCE (0xFFFF_E038) Bit Symbol Read/Write After reset Function 0 0 Must be set to 11.
6
5
EIM381
4
EIM380
3
DM38 R/W
2
IL382
1
IL381
0
IL380
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 56 (INTTB9) when not to DM38 = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DM38 = 1. interrupt 000-011: 0 to 3 number 56 100-111: Invalid settings to activate the DMAC.
15
Bit Symbol Read/Write After reset Function
14
13
EIM391 0
12
EIM390 0
11
DM39 R/W 0 Must be set to 0.
10
IL392 0
9
IL391 0
8
IL390 0
Must be set to 00.
Must be set to 000.
23
Bit Symbol Read/Write After reset Function
22
21
EIM3A1 0
20
EIM3A0 0
19
DM3A R/W
18
IL3A2
17
IL3A1
16
IL3A0
Must be set to 01.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 58 (INTRTC) when not to DM3A = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM3A = 1.
interrupt number 58 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
31
Bit Symbol Read/Write After reset Function
30
29
EIM3B1
28
EIM3B0 0
27
DM3B R/W 0
26
IL3B2
25
IL3B1
24
IL3B0
0
0
Must be set to 11.
0 0 0 Sets Sets the priority level for interrupt whether or number 59 (INTAD) when not to DM3B = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM3B = 1.
interrupt number 59 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-60
TMP1942CY/CZ
7
IMCF (0xFFFF_E03C) Bit Symbol Read/Write After reset Function 0 0 Must be set to 10.
6
5
EIM3C1
4
EIM3C0
3
DM3C R/W
2
IL3C2
1
IL3C1
0
IL3C0
0: Not set.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 60 (INTDMA0) when not to DM3C = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 Selects a DMAC channel when
1: Set DM3C = 1. interrupt 000-011: 0 to 3 number 60 100-111: Invalid settings to activate the DMAC.
15
Bit Symbol Read/Write After reset Function
14
13
EIM3D1 0
12
EIM3D0 0
11
DM3D R/W 0
10
IL3D2
9
IL3D1
8
IL3D0
Must be set to 10.
0 0 0 Sets Sets the priority level for interrupt whether or number 61 (INTDMA1) when not to DM3D = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM3D = 1.
interrupt number 61 to activate the DMAC.
000-011: 0 to 3 100-111: Invalid settings
23
Bit Symbol Read/Write After reset Function
22
21
EIM3E1 0
20
EIM3E0 0
19
DM3E R/W 0
18
IL3E2
17
IL3E1
16
IL3E0
Must be set to 10.
0 0 0 Sets Sets the priority level for interrupt whether or number 62 (INTDMA1) when not to DM3E = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM3E = 1. interrupt 000-011: 0 to 3 number 62 100-111: Invalid settings to activate
the DMAC.
31
Bit Symbol Read/Write After reset Function
30
29
EIM3F1
28
EIM3F0 0
27
DM3F R/W
26
IL3F2
25
IL3F1
24
IL3F0
0
0
Must be set to 10.
0 0 0 0 Sets Sets the priority level for interrupt whether or number 63 (INTDMA2) when not to DM3F = 0. activate the 000: Disable interrupt. DMAC. 001-111: 1 to 7 0: Not set. Selects a DMAC channel when 1: Set DM3F = 1. interrupt 000-011: 0 to 3 number 63 100-111: Invalid settings to activate
the DMAC.
Note : Before enabling the above interrupt requests, be sure to set their active state.
TMP1942CY/CZ-61
TMP1942CY/CZ
Interrupt request clear register: Sets the value of IVR for the interrupt whose request is to be cleared. 7
INTCLR Bit Symbol After reset Function

6

5
EICLR5
4
EICLR4
3
EICLR3 W
2
EICLR2
1
EICLR1
0
EICLR0
(0xFFFF_E060) Read/Write
Sets the value of IVR<9:4> for the interrupt whose request is to be cleared.
Note1: Do not clear an interrupt request before reading the corresponding IVR value. Note2: Follow the steps below to disable a particular interrupt with the Interrupt Controller (INTC). 1. Globally disable the acceptance of interrupts by the core processor by clearing the IEc bit of the Status register. 2. Disable the desired interrupt with the INTC by clearing the ILx[2:0] field of the IMCxx register. 3. Execute the SYNC instruction. 4. Enable the acceptance of interrupts by the core processor by setting the IEc bit of the Status register. Example: mtc0 sb sync mtc0 $sp, r31 r0, r31 r0, IMC** ; _DI () ; ; IMC** = 0 ; ; _SYNC () ; ; _EI () ;
TMP1942CY/CZ-62
TMP1942CY/CZ
3.5 I/O Ports
The TMP1942 has 108 I/O port pins. All the port pins except a few share pins with alternate functions. They can be individually programmed as general-purpose I/O or dedicated I/O for the on-chip CPU or peripherals. Table 3.5.1 Programmable I/O Ports(1/2)
Port Port 0 Port 1 Port 2 Pin Name P00~P07 P10~P17 P20~P27 P30 P31 P32 Port 3 P33 P34 P35 P36 P37 P40 P41 Port 4 P42 P43 P44 Port 5 Port 6 P50~P57 P60~P67 P90 P91 P92 P93 Port 9 P94 P95 P96 P97 # of Pins 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 8 8 1 1 1 1 1 1 1 1 Direction Input/output Input/output Input/output Output Output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input Input Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Pull up Pull up Pull up Pull up Pull up Pull up Pull up Pull up Pull up Pull up Pull Resistor Direction Programmability Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Fixed Fixed Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise AD0~AD7 AD8~AD15 A0~A7 RD WR HWR WAIT BUSRQ BUSAK R/W DSU CS0 CS1 CS2 CS3 SCOUT AN0~AN7 AN8~AN15 KEY8 KEY9 TB40UT TB5OUT TB6OUT TB7IN0 TB7IN1 TB7OUT ADTRG KEY0-KEY7 A8~A15 A16~A23 Alternate Functions
TMP1942CY/CZ-63
TMP1942CY/CZ
Table 3.5.1 Programmable I/O Ports(2/2)
Port Pin Name PA0 PA1 PA2 Port A PA3 PA4 PA5 PA6 PA7 PB0 PB1 PB2 PB3 Port B PB4 PB5 PB6 PB7 PC0 PC1 PC2 Port C PC3 PC4 PC5 PC6 PC7 PD0 PD1 PD2 Port D PD3 PD4 PD5 PD6 PD7 PE0 PE1 PE2 Port E PE3 PE4 PE5 PE6 PE7 PF0 PF1 PF2 Port F PF3 PF4 PF5 PF6 # of Pins 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Direction Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Input/output Pull Resistor Direction Programmability Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise Bitwise bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit bit Alternate Functions TB0IN0 TB0IN1 TB0OUT TB1IN0 TB1IN1 TB1OUT TA1OUT TA0IN TB2IN0 TB2IN1 TB2OUT TB3IN0 TB3IN1 TB3OUT TA3OUT TA2IN TA4IN TA6IN TA8IN TA5OUT TAAIN TA7OUT TB8IN0 TB8IN1 TXD0 RXD0 SCLK0 TXD1 RXD1 SCLK1 XT1 XT2 TXD3 RXD3 SCLK3 TXD4 RXD4 SCLK4 INT1 INT2 TXD5 RXD5 SCLK5 SCK SO SI INT0 SDA SCL CTS4 BOOT INTLV KEYD CTS5 KEYC TA9OUT TB9IN0 TB9IN1 CTS0 TBAIN0 TBAIN1 CTS1 TABOUT INT7 INT8 INT9 INTA KEYB KEYA INTB INTC TB4IN0 INTD INTE TB4IN1 INT5 INT6 INT3 INT4
CTS3
TMP1942CY/CZ-64
TMP1942CY/CZ
Table 3.5.2 I/O Port Programmability (1/4) Port Pin Name Direction / Function
Input Port 0 P00~P07 Output AD0~AD7 Bus Input Port 1 P10~P17 Output AD8~AD15 Bus A8~A15 Bus Input Port 2 P20~P27 Output A0~A7 Bus A16~A23 Bus P30 P31 Output RD Output WR Input(RSTUP=1) P32 Input(RSTUP=0) Output HWR Input(RSTUP=1) P33 Input(RSTUP=0) Output WAIT Input(RSTUP=1) P34 Input(RSTUP=0) Output BUSRQ Input(RSTUP=1) P35 Input(RSTUP=0) Output BUSAK Input(RSTUP=1) P36 Input(RSTUP=0) Output R/W Input Output Input(RSTUP=1) P40 Port 4 P41 Input(RSTUP=0) Output CS0 Input(RSTUP=1) Input(RSTUP=0) Output CS1
I/O Register Settings Pn
1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 1 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 1
PnCR
0 1 0 1 0 1 0 1 0 1
PnFC
PnFC2
0 0 1 1 0 0 1 1 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1
Port 3
P37
TMP1942CY/CZ-65
TMP1942CY/CZ
Table 3.5.2 I/O Port Programmability (2/4) Port Pin Name Direction / Function
Input(RSTUP=1) P42 Input(RSTUP=0) Output CS2 Input(RSTUP=1) Port 4 P43 Input(RSTUP=0) Output CS3 Input P44 Output SCOUT Input Port 5 P50~P57 AN0~AN7 ADTRG Input Port 6 P60~P67 AN8~AN15 KEY0~7 P90~P97 P90 P91 Port 9 P92 P93 P94 P95 P96 P97 PA0~PA7 PA0 PA1 PA2 Port A PA3 PA4 PA5 PA6 PA7 Input Output KEY8 KEY9 TB40UT TB5OUT TB6OUT TB7IN0 TB7IN1 TB7OUT Input Output TB0IN0 INT3 TB0IN1 INT4 TB0OUT TB1IN0 INT5 TB1IN1 INT6 TB1OUT TA1OUT TA0IN KEYA
I/O Register Settings Pn
1 0 1 0 1 1 0 1 0 0 1 1 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0
PnCR
0 0 1 0 0 1 0 1 -
PnFC
0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1* 1 1* 1 1 1 1 1 1 1
PnFC2
TMP1942CY/CZ-66
TMP1942CY/CZ
Table 3.5.2 I/O Port Programmability (3/4) Port Pin Name
PB0~PB7 PB0 PB1 PB2 Port B PB3 PB4 PB5 PB6 PB7
Direction / Function
Input Output TB2IN0 INTB TB2IN1 INTC TB2OUT TB4IN0 TB3IN0 INTD TB3IN1 INTE TB3OUT TB4IN1 TA3OUT TA2IN INT7 KEYB Input Output TA4IN INT8 TA6IN INT9 TA8IN INTA TA5OUT TAAIN TA7OUT TB8IN0 KEYC TB8IN1 TA9OUT Input Output TXD0 TB9IN0 RXD0 TB9IN1 SCLK0(Input) SCLK0(Output) CTS0 TXD1 TBAIN0 RXD1 TBAIN1
I/O Register Settings Pn
-
PnCR
0 1 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 0
PnFC
0 0 1 1* 1 1* 1 1 1 1* 1 1* 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1
PnFC2
PC0~PC7 PC0 PC1 PC2 PC3 PC4 PC5 PC6 PC7 PD0~PD7 PD0 PD1 Port D PD2
Port C
-
PD3 PD4
TMP1942CY/CZ-67
TMP1942CY/CZ
Table 3.5.2 I/O Port Programmability (4/4) Port Pin Name Direction / Function
SCLK1(Input) SCLK1(Output) CTS3 TABOUT XT1 XT2 Input Output TXD3 RXD3 SCLK3(Input) SCLK3(Output) CTS3 TXD4 RXD4 SCLK4(Input) SCLK4(Output) CTS4 INT1 INT2 Input Output TXD5 RXD5 KEYD SCLK5(Input) SCLK5(Output) CTS SCK(Input) SCK(Output) SO SDA SI SCL INT0
I/O Register Settings Pn
-
PnCR
0 1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 1 0 0 1 1 1 1 1 0
PnFC
1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1* 1* 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1*
PnFC2
0 0 0 1 -
PD5 Port D PD6 PD7 PE0~PE7 PE0 PE1 PE2 Port E PE3 PE4 PE5 PE6 PE7 PF0~PF6 PF0 PF1
PF2 Port F PF3 PF4 PF5 PF6
X: Don't care Pn: Port n Register, PnCR: Port n Control Register, PnFC: Port n Function Register *: Set this bit when using the pin for a STOP mode termination interrupt with SYSCR set to 0. Otherwise, the bit need not be set. Note 1:
HWR , R / W and P40 to P43 have their internal pullup resistors enabled when the corresponding P4FC register bit is set and when the bus is released.
Note 2: When P50-P57 are configured as analog channels of the ADC, the ADCH[2:0] field in A/D Mode Control Register 1 (ADMOD1) is used to select a channel(s). Note 3: When P57 is configured as ADTRG , the ADTRGE bit in the ADMOD1 register is used to enable and disable the external trigger input to the ADC. Note 4: When PD6-PD7 are configured as XT1-XT2, the SYSCR0 register must be programmed to enable oscillation, etc. Note 5: When PortD and PortE and PortF are configured as SDA and SCL outputs for the SBI, the ODEA[7:6] field in the Open-Drain Enable (ODE) register can be used to configure them as either push-pull or open-drain ouptuts. Upon reset, the default is push-pull.
TMP1942CY/CZ-68
TMP1942CY/CZ
3.5.1
Port 0 (P00-P07)
Port 0 is an 8-bit general-purpose input/output port whose bits can each be set independently for input or output. Use the control register P0CR to set the port for input or output. A reset clears all bits of P0CR to 0 and puts port 0 in input mode. In addition to functioning as a general-purpose input/output port, this port can also function as an address/data bus (AD0-AD7). When external memory is accessed, this port automatically functions as an address/data bus (AD0-AD7), with all bits of P0CR cleared to 0.
Reset
Direction Control (bitwise) STOP DRIVE Write to P0CR Internal Data Bus
Output Latch Output Buffer Write to P0
Port 0 P00-P07 (AD0-AD7)
Read P0
Figure 0.1 Port 0 (P00-P07) Note: The above system diagram does not represent the address/data bus function.
TMP1942CY/CZ-69
TMP1942CY/CZ
Port 0 Register 7
P0 (0xFFFF_F000) Bit Symbol Read/Write After Reset P07
6
P06
5
P05
4
P04 R/W
3
P03
2
P02
1
P01
0
P00
Input mode (output latch register cleared to 0)
Port 0 Control Register 7
P0CR (0xFFFF_F002) Bit Symbol Read/Write After Reset Function 0 0 0 0 P07C
6
P06C
5
P05C
4
P04C W
3
P03C 0
2
P02C 0
1
P01C 0
0
P00C 0
0: IN 1: OUT (Functions as AD7-AD0 when external area is accessed, with the register cleared to 0.) Input/output setting for port 0 0 1 Input Output
Figure 0.2 Registers Related to Port 0
TMP1942CY/CZ-70
TMP1942CY/CZ 3.5.2 Port 1 (P10-P17)
Port 1 is an 8-bit general-purpose input/output port whose bits can each be set independently for input or output. The control register P1CR and function register P1FC are used to set the port for input or output. A reset clears all bits of output latch P1 and all bits of P1CR and P1FC to 0, putting port 1 in input mode. In addition to functioning as a general-purpose input/output port, this port can also function as an address/data bus (AD8-AD15) or an address bus (A8-A15). To access external memory, set this port to an address bus or address/data bus using P1CR and P1FC.
Reset
Direction Control (bitwise)
Write to P1CR
Function Control (bitwise) Internal Data Bus
Write to P1FC STOP DRIVE Port 1 P10-P17 (AD8-AD15/A8-A15)
Output Latch Output Buffer Write to P1
Read P1
Figure 0.3 Port 1 (P10-P17) Note: The above system diagram does not represent the address/data bus function.
TMP1942CY/CZ-71
TMP1942CY/CZ
Port 1 Register 7
P1 (0xFFFF_F001) Bit Symbol Read/Write After Reset P17
6
P16
5
P15
4
P14 R/W
3
P13
2
P12
1
P11
0
P10
Input mode (output latch register cleared to 0)
Port 1 Control Register 7
P1CR (0xFFFF_F004) Bit Symbol Read/Write After Reset Function 0 0 0 0 P17C
6
P16C
5
P15C
4
P14C W
3
P13C 0
2
P12C 0
1
P11C 0
0
P10C 0
<< Refer to P1FC. >>
Port 1 Function Register 7
P1FC (0xFFFF_F005) Bit Symbol Read/Write After Reset Function 0 0 0 0 P17F
6
P16F
5
P15F
4
P14F W
3
P13F 0
2
P12F 0
1
P11F 0
0
P10F 0
P1FC/P1CR = 00: IN, 01: OUT, 10: AD15-8, 11: A15-8
Function settings for port 1 P1CR 0 1 P1FC 0 Input port Output port 1 Address/data bus (AD15-AD8) Address bus (A15-A8)
Figure 0.4 Registers Related to Port 1
TMP1942CY/CZ-72
TMP1942CY/CZ 3.5.3 Port 2 (P20-P27)
Port 2 is an 8-bit general-purpose input/output port whose bits can each be set independently for input or output. The control register P2CR and function register P2FC are used to set the port for input or output. A reset sets all bits of output latch P2 to 1 and clears all bits of P2CR and P2FC to 0, putting port 2 in input mode. In addition to functioning as a general-purpose input/output port, this port can function as an address bus (A0-A7 or A16-A23).
A16-23 A0-7 Reset
Selector S
B A
Y
Direction Control (bitwise)
Write to P2CR
Function Control (bitwise) Internal Data Bus STOP DRIVE S B Selector Output Latch A Y Output Buffer Write to P2 Port 2 P20-P27 (A0-A7/A16-A23)
Write to P2FC
Read P2
Figure 0.5 Port 2 (P20-P27)
TMP1942CY/CZ-73
TMP1942CY/CZ
Port 2 Control Register 7
P2 (0xFFFF_F012) Bit Symbol Read/Write After Reset P27
6
P26
5
P25
4
P24 R/W
3
P23
2
P22
1
P21
0
P20
Input mode (output latch register set to 1)
Port 2 Control Register 7
P2CR (0xFFFF_F014) Bit Symbol Read/Write After Reset Function 0 0 0 0 P27C
6
P26C
5
P25C
4
P24C W
3
P23C 0
2
P22C 0
1
P21C 0
0
P20C 0
<< Refer to P2FC.>>
Port 2 Function Register 7
P2FC (0xFFFF_F015) Bit Symbol Read/Write After Reset Function 0 0 0 0 P27F
6
P26F
5
P25F
4
P24F W
3
P23F 0
2
P22F 0
1
P21F 0
0
P20F 0
P2FC/P2CR = 00: IN, 01: OUT, 10: A7-0, 11: A23-16
Function settings for port 2 P2CR 0 1 0 Input port Output port P2FC 1 Address bus (A7-A0) Address bus (A23-A16)
Figure 0.6 Registers Related to Port 2
TMP1942CY/CZ-74
TMP1942CY/CZ 3.5.4 Port 3 (P30-P37)
Port 3 is an 8-bit general-purpose input/output port whose bits can each be set independently for input or output, with the exception that P30 and P31 are output-only. The control register P3CR and function register P3FC are used to set the port for input or output. A reset sets bits P30, P31 and P37 of the output latch to 1. Bits P32 to P36 are set to 1 by a reset if RSTPUP is High or cleared to 0 if RSTPUP is Low. All bits of P3CR (bits 0 and 1 not used) and P3FC (bits 3 and 7 not used) are cleared to 0 by a reset, with P30 and P31 outputting a High signal and P32 to P36 placed in input mode with pull-up resistors enabled (if RSTPUP is High) or disabled (if RSTPUP is Low). P37 is placed in input mode with a pull-up resistor enabled regardless of the value of RSTPUP. In addition to functioning as a general-purpose input/output port, this port can also input and output the CPU's control and status signals. The RD strobe is output only when an external address area is being accessed while the P30 pin is set for RD output ( = 1). Similarly, the WR strobe is output only when an external address area is being accessed while the P31 pin is set for WR output ( = 1). P32 and P36 have their pull-up resistors enabled when BUSAK = 0 while = 1.
Reset
Function Control (bitwise)
Internal Data Bus
Write to P3FC
Selector
S Output Latch
S A B P30 ( RD ) P31 ( WR )
Output Buffer
Write to P3
RD , WR
Read P3
Figure 0.7 Port 3 (P30, P31)
TMP1942CY/CZ-75
TMP1942CY/CZ
Reset
Direction Control (bitwise)
Write to P3CR
STOP DRIVE
Function Control (bitwise)
InternalDataBus
Write to P3FC RSTPUP S
Selector
P-ch
Programmable Pull-up Resistor
S
R
A
Output Latch B Write to P3
Output Buffer
P32 ( HWR ) P35 ( BUSAK )
P36 ( R / W ) Reset
HWR , BUSAK , R / W
Read P3
Figure 0.8 Port 3 (P32, P35, P36)
TMP1942CY/CZ-76
TMP1942CY/CZ
Reset
Direction Control (bitwise)
STOP DRIVE
Write to P3CR RSTPUP
Internal Data Bus
P-ch
Programmable Pull-up Resistor
S R Output Latch Output Buffer Write to P3 Reset
P33 ( WAIT )
Internal WAIT Reset
Read P3
Direction Control (bitwise)
STOP DRIVE
Write to P3CR
Function Control (bitwise)
Write to P3FC
Internal Data Bus
P-ch RSTPUP
Programmable Pull-up Resistor
S R Output Latch Output Buffer Write to P3 Reset
P34 ( BUSRQ )
Read P3 Internal BUSRQ
Figure 0.9 Port 3 (P33, P34)
TMP1942CY/CZ-77
TMP1942CY/CZ
Reset
Direction Control (bitwise)
STOP DRIVE
Write to P3CR P-ch
Internal data bus
Programmable Pull-up Resistor
S Output Latch Output Buffer Write to P3
P37 ( DSU )
Internal DSU
Read P3
Figure 0.10 Port 3 (P37)
TMP1942CY/CZ-78
TMP1942CY/CZ
Port 3 Register 7
P3 (0xFFFF_F018) Bit Symbol Read/Write After Reset RSTPUP = 0 1 (Pull-UP) 0 0 Input Mode 0 0 0 P37
6
P36
5
P35
4
P34 R/W
3
P33
2
P32
1
P31
0
P30
Output Mode 1 1 1 1
RSTPUP = 1 1 (Pull-UP) 1 (Pull-UP) 1 (Pull-UP) 1 (Pull-UP) 1 (Pull-UP) 1 (Pull-UP)
Port 3 Control Register 7
P3CR (0xFFFF_F01A) Bit Symbol Read/Write After Reset Function 0 0 0 P37C
6
P36C
5
P35C W
4
P34C 0 0: IN
3
P33C 0 1: OUT
2
P32C 0
1

0

Input/output settings for port 3 0 1 Input Output
Port 3 Function Register 7
P3FC (0xFFFF_F01B) Bit Symbol Read/Write After Reset Function

6
P36F 0 0: PORT 1: R / W
5
P35F 0 0: PORT 1: BUSAK
4
P34F W 0 0: PORT 1: BUSRQ
3

2
P32F 0 0: PORT 1: HWR
1
P31F 0 0: PORT 1: WR
0
P30F 0 0: PORT 1: RD
BUSRQ settings
P3FC P3CR 1 0
P30 ( RD ) function settings 0 1 1 1 P31 ( WR ) function settings 1 1 0 1 0 Outputs 0. 1 Outputs 1. 0 Outputs 0. 1 Outputs 1.
BUSAK settings
P3FC P3CR R / W settings P3FC P3CR
Outputs RD only during external access.
Outputs WR WR only during external access.
HWR settings
P3FC P3CR 1 1
Figure 0.11 Registers Related to Port 3
TMP1942CY/CZ-79
TMP1942CY/CZ 3.5.5 Port 4 (P40-P44)
Port 4 is a 5-bit general-purpose input/output port whose bits can each be set independently for input or output. The control register P4CR and function register P4FC are used to set the port for input or output. Bits P41 to P44 of the output latch register are set to 1 by a reset if RSTPUP is High or cleared to 0 if RSTPUP is Low. Bit P44 of the output latch register is set to 1 regardless of the value of RSTPUP. All bits of P4CR and P4FC are cleared to 0 by a reset, with P40 to P43 placed in input mode with pull-up resistors enabled (if RSTPUP is High) or disabled (if RSTPUP is Low). P44 is placed in input mode with a pull-up resistor disabled regardless of the value of RSTPUP. In addition to functioning as a general-purpose input/output port, P40-P43 can also output the chip select signals (CS0-CS3), and P44 functions as the SCOUT pin, outputting the system clock.
Reset
Direction Control (bitwise)
Write to P4CR
STOP DRIVE
Function Control (bitwise)
Internal Data Bus
Write to P4FC RSTPUP S A
Selector
P-ch
Programmable Pull-up Resistor
S
R
P40 ( CS0 ) Output Latch Reset P41 ( CS1) P42 ( CS2 ) P43 ( CS3 )
Output Latch
B Write to P4
CS0 , CS1, CS2 , CS3
Read P4
Figure 0.12 Port 4 (P40-P43)
TMP1942CY/CZ-80
TMP1942CY/CZ
Reset R Direction Control (bitwise) STOP DRIVE
Write to P4CR R Function Control (bitwise)
Internal data bus
Write to P4FC
S Output Latch
AS Selector Y P44 (SCOUT) Reset
Write to P4
B
S
B
Y Selector Read P4 fSYS clock fs clock A Selector B S Y A
SYSCR3
Figure 0.13 Port 4 (P44)
TMP1942CY/CZ-81
TMP1942CY/CZ
Port 4 Register 7
P4 (0xFFFF_F01E) Bit Symbol Read/Write After Reset RSTPUP=1 RSTPUP=0

6

5

4
P44
3
P43
2
P42 R/W Input mode
1
P41
0
P40
1 1
1 (Pull-Up) 1 (Pull-Up) 1 (Pull-Up) 1 (Pull-Up) 0 0 0 0 RSTPUp = 1 RSTPUp = 0
Port 4 Control Register 7
P4CR (0xFFFF_F020) Bit Symbol Read/Write After Reset

6

5

4
P44C 0
3
P43C 0 0: IN
2
P42C W 0
1
P41C 0 1: OUT
0
P40C 0
Port 4 Function Register 7
P4FC (0xFFFF_F021) Bit Symbol Read/Write After Reset Function

6

5

4
P44F 0 0: PORT 1: SCOUT
3
P43F 0
2
P42F W 0 0: PORT 1: CS
1
P41F 0
0
P40F 0
0 1 0 1 0 1 0 1
PORT (P40) CS0 PORT (P41)
CS1
PORT (P42) CS2 PORT (P43)
CS3
Figure 0.14 Registers Related to Port 4
TMP1942CY/CZ-82
TMP1942CY/CZ 3.5.6 Port 5 (P50-P57)
Port 5 is an 8-bit input-only port, and is shared with the A/D converter's analog input pins. P57 also functions as the A/D converter's A/D trigger input pin.
Internal Data Bus
Read Port 5
Port 5 P50-P56 (AN0-AN7)
Conversion Result Register Read A/D
A/D Converter
Channel Selector
Function Control Write P5FC Port 5 P57 (AN7)/ ADTRG
Internal Data Bus
Read Port 5
Conversion Result Register Read A/D
A/D Converter
Channel Selector
ADTRG (P57 Only)
Figure 0.15 Port 5 (P50-P57)
TMP1942CY/CZ-83
TMP1942CY/CZ
Port 5 Register 7
P5 (0xFFFF_F040) Bit Symbol Read/Write After Reset P57
6
P56
5
P55
4
P54 R
3
P53
2
P52
1
P51
0
P50
Input mode
Port 5 Function Register 7
P5FC (0xFFFF_F043) Bit Symbol Read/Write After Reset Function P57F W 0
0: Port or A/D input 1: ADTRG
6

5

4

3

2

1

0

Figure 0.16 Port 5 (P50-P57) Note 1: Use A/D converter mode register ADMOD4 to select A/D converter input channels and to enable A/D trigger input for P57. Note 2: To use ADTRG , first set to 1 and then enable trigger input in A/D converter mode register ADMOD4. To stop using ADTRG , first disable trigger input in ADMOD4 and then clear to 0 (port).
TMP1942CY/CZ-84
TMP1942CY/CZ 3.5.7 Port 6 (P60-P67)
Port 6 is an 8-bit input-only port, and is shared with the A/D converter's analog input pins and key input pins. A reset clears P6FC to 0, placing port 6 in A/D or port input mode. Writing a 1 to a bit of P6FC enables the corresponding pin to be used as a key input pin. Port 6 has pull-up resistors, which are enabled only for those pins for which KWUPCNT is set to 1 in the key on wake-up circuit and key input is enabled in KWUPSTn. For details, refer to the description of the key on wake-up function.
Function Control Write P6FC Port 6 P60-67 (AN8-15)/ KEY0-7
Internal Data Bus
Read Port 6
Conversion Result Register Read A/D
A/D Converter
Channel Selector
KEY0-7 DPE
A
Selector
KEYmEN Y PE
fs
TG
B
Figure 0.17 Port 6 (P60-P67)
Port 6 Register 7
P6 (0xFFFF_F041) Bit Symbol Read/Write After Reset P67
6
P66
5
P65
4
P64 R
3
P63
2
P62
1
P61
0
P60
Input mode
Port 6 Function Register 7
P6FC (0xFFFF_F045) Bit Symbol Read/Write After Reset Function P67F
6
P66F
5
P65F
4
P64F W 0
3
P63F
2
P62F
1
P61F
0
P60F
0: Port or A/D input 1: Key input
Figure 0.18 Registers Related to Port 6
TMP1942CY/CZ-85
TMP1942CY/CZ 3.5.8 Port 9 (P90-P97)
Port 9 is an 8-bit general-purpose input/output port whose bits can each be set independently for input or output. The control register P9CR is used to set the port for input or output. A reset clears P9CR to 0, putting port 9 in input mode. In addition to functioning as an input/output port, the pins of this port can also function as various input/output pins: P90 and P91 function as key input, P92 to P94 and P97 as 16-bit timer output, and P95 and P96 as 16-bit timer input. These functions are enabled by setting the corresponding bits of P9FC to 1. A reset clears P9CR and P9FC to 0, placing port 9 in input mode. Pins P90 and P91 have pull-up resistors, which are enabled only for those pins for which KWUPCNT is set to 1 in the key on wake-up circuit and key input is enabled in KWUPSTn. For details, refer to the description of the key on wake-up function. When a pin is functioning as a port pin, its pull-up resistor is disabled. When the DSU is enabled, port 9 functions as a DSU interface regardless of the settings in P9CR and P9FC, so that the pins cannot be used as general-purpose port pins or peripheral function pins as described above.
Function Control Reset Write to P9FC
Direction Control (bitwise) STOP DRIVE Write to P9CR
S
Internal Data Bus
Output Latch
P90 (KEY8) P91 (KEY9) Output Buffer Reset
Write to P9
Read P9 KEY8, 9 DPE
A
Selector
KEYmEN Y PE
fs
TG
B
Figure 0.19 Port 9 (P90, P91)
TMP1942CY/CZ-86
TMP1942CY/CZ
Reset
Direction Control (bitwise)
Write to P9CR
Function Control (bitwise)
STOP DRIVE
Write to P9FC
Internal DataBus
S Output Latch Write to P9 S Selector Read P9 A B P95 (TB7IN0) P96 (TB7IN1)
TB7IN0, 1
Reset
Direction Control (bitwise)
Write to P9CR
Function Control (bitwise)
STOP DRIVE
Internal Data Bus
Write to P9FC S Output Latch
A
S Selector P92 (TB4OUT) P93 (TB5OUT) P94 (TB6OUT) P97 (TB7OUT)
Write to P9 Timer F/F Output TB4OUT: Timer B4 TB5OUT: Timer B5 TB6OUT: Timer B6 TB7OUT: Timer B7 B
S Selector
B
Read P9
A
Figure 0.20 Port 9 (P92-P97)
TMP1942CY/CZ-87
TMP1942CY/CZ
Port 9 Register 7
P9 Bit Symbol (0xFFFF_F04C) Read/Write After Reset P97
6
P96
5
P95
4
P94 R/W
3
P93
2
P92
1
P91
0
P90
Input mode (output latch register set to 1)
Port 9 Control Register 7
P9CR (0xFFFF_F04E) Bit Symbol Read/Write After Reset Function 0 0 0 0 0: IN P97C
6
P96C
5
P95C
4
P94C W
3
P93C 0 1: OUT
2
P92C 0
1
P91C 0
0
P90C 0
Input/output settings for port 9 0 1 Input Output
Port 9 Function Register 7
P9FC (0xFFFF_F04F) Bit Symbol Read/Write After Reset Function 0 0 0 0: PORT 1: TB7IN0 0 0: PORT 0: PORT 1: TB7OUT 1: TB7IN1 P97F
6
P96F
5
P95F
4
P94F W
3
P93F 0
2
P92F 0
1
P91F 0
0
P90F 0 0: PORT 1: KEY8
0: PORT 0: PORT 0: PORT 0: PORT 1: TB6OUT 1: TB5OUT 1: TB4OUT 1: KEY9
Function
Select KEY8 input Select KEY9 input Select TB4OUT output Select TB5OUT output Select TB6OUT output Select TB7IN0 input Select TB7IN1 input Select TB7OUT output
Corresponding P9FC Bit
1 1 1 1 1 1 1 1
Corresponding P9CR Bit
0 0 1 1 1 0 0 1
Port Used
P90 P91 P92 P93 P94 P95 P96 P97
Figure 0.21 Registers Related to Port 9
TMP1942CY/CZ-88
TMP1942CY/CZ
3.5
3.5.9
Port A (PA0-PA7)
Port A is an 8-bit general-purpose input/output port whose bits can each be set independently for input or output. The control register PACR is used to set the port for input or output. A reset clears PACR to 0, putting port A in input mode. In addition to functioning as an input/output port, the pins of this port can also function as various input/output pins: PA0, PA1, PA3 and PA4 function as 16-bit timer input or external interrupt input, PA2 and PA5 as 16-bit timer output, PA6 as 8-bit timer output, and PA7 as 8-bit timer input or key input. These functions are enabled by setting the corresponding bits of PAFC to 1. A reset clears PACR and PAFC to 0, placing port A in input mode. PA7 has a pull-up resistor, which is enabled only when KWUPCNT is set to 1 in the key on wake-up circuit and key input is enabled by setting 1 in PAFC. When the pin is functioning as a port pin, its pull-up resistor is disabled.
Reset
Direction Control (bitwise)
Write to PACR STOP DRIVE
Function Control (bitwise) Internal Data Bus
Write to PAFC S Output Latch A Selector Write to PA Timer F/F Output TB0OUT TB1OUT TA1OUT S B Selector Read PA A B PA2 (TB0OUT) PA5 (TB1OUT) PA6 (TA1OUT)
S
Figure 3.5.21 Port A (PA2, PA5, PA6)
TMP1942CY/CZ-89
TMP1942CY/CZ
Reset
Direction Control (bitwise)
Write to PACR STOP DRIVE
Function Control (bitwise) Internal Data Bus
Write to PAFC S Output Latch PA0 (TB0IN0/INT3) PA1 (TB0IN1/INT4) S Selector Read PA TB0IN0, TB0IN1 INT3, INT4 Reset A
Write to PA
B
Direction Control (bitwise) STOP DRIVE
Write to PACR
Function Control (bitwise) Internal data bus
Write to PAFC S Output Latch PA7 (TA0IN/KEYA)
Write to PA
S Selector
B
Reset
Read PA TA0IN KEYA DPE Selector A TG
A
KEYmEN Y PE
fs
B
Figure 3.5.22 Port A (PA0, PA1, PA7)
TMP1942CY/CZ-90
TMP1942CY/CZ
Reset
Direction Control (bitwise)
Write to PACR STOP DRIVE
Function Control (bitwise) Internal data bus
Write to PAFC S Output Latch PA3 (TB1IN0/INT5) PA4 (TB1IN1/INT6) S Selector Read PA TB1IN0, TB1IN1 INT5, INT6 A
Write to PA
B
Figure 3.5.23 Port A (PA3, PA4)
TMP1942CY/CZ-91
TMP1942CY/CZ
Port A Register 7
PA (0xFFFF_F050) Bit Symbol Read/Write After Reset 1 1 1 1 PA7
6
PA6
5
PA5
4
PA4 R/W
3
PA3
2
PA2
1
PA1
0
PA0
Input mode (output latch register set to 1) 1 1 1 1
Port A Control Register 7
PACR (0xFFFF_F052) Bit Symbol Read/Write After Reset Function 0 0 0 0: IN 0 1: OUT Input/output settings for port A 0 1 Input Output PA7C
6
PA6C
5
PA5C
4
PA4C W
3
PA3C 0
2
PA2C 0
1
PA1C 0
0
PA0C 0
Port A Function Register 7
PAFC (0xFFFF_F053) Bit Symbol Read/Write After Reset Function 0 0: PORT 1: TA0IN KEYA 0 0: PORT 0 0: PORT 0 0: PORT PA7F
6
PA6F
5
PA5F
4
PA4F W
3
PA3F 0 0: PORT
2
PA2F 0 0: PORT
1
PA1F 0 0: PORT
0
PA0F 0 0: PORT 1: TB0IN0 INT3
1: TA1OUT 1: TB1OUT 1: TB1IN1 INT6
1: TB1INT0 1: TB0OUT 1: TB0IN1 INT5 INT4
Function
Select TB0IN0 input Select INT3 input Select TB0IN1 input Select INT4 input Select TB0OUT output Select TB1IN0 input Select INT5 input Select TB1IN1 input Select INT6 input Select TB1OUT output Select TA1OUT output Select TA0IN input Select KEYA input
Corresponding PAFC Bit
1 1 (*1) 1 1 (*1) 1 1 Need not be set 1 Need not be set 1 1 1 1
Corresponding PACR Bit
0 0 0 0 1 0 0 0 0 1 1 0 0
Port Used
PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7
(*1) Note:
Set this bit when using the pin for a STOP mode termination interrupt with SYSCR set to 0. Otherwise, the bit need not be set. For a pin to which two input functions are assigned in addition to the port function, use the control register for each function module to specify which function is used. Figure 3.5.24 Registers Related to Port A
TMP1942CY/CZ-92
TMP1942CY/CZ 3.5.10 Port B (PB0-PB7)
Port B is an 8-bit general-purpose input/output port whose bits can each be set independently for input or output. The control register PBCR is used to set the port for input or output. A reset clears PBCR to 0, putting port B in input mode. In addition to functioning as an input/output port, the pins of this port can also function as various input/output pins: PB0, PB1, PB3 and PB4 function as 16-bit timer input or external interrupt input, PB2 and PB5 as 16-bit timer input or output, PB7 as 8-bit timer input, interrupt input or key input. These functions are enabled by setting the corresponding bits of PBFC to 1. A reset clears PBCR and PBFC to 0, placing port B in input mode. PB7 has a pull-up resistor, which is enabled only when KWUPCNT is set to 1 in the key on wake-up circuit and key input is enabled in KWUPSTn. For details, refer to the description of the key on wake-up function. When the pin is functioning as a port pin, its pull-up resistor is disabled.
Reset
Direction Control (bitwise)
Write to PBCR STOP DRIVE
Function Control (bitwise) Internal Data Bus
Write to PBFC S Output Latch A Selector Write to P7 Timer F/F Output TB2OUT TB3OUT S B Selector Read to P7 TB4IN0 TB4IN1 A B PB2 (TB2OUT/TB4IN0) PB5 (TB3OUT/TB4IN1)
S
Figure 3.5.25 Port B (PB2, PB5)
TMP1942CY/CZ-93
TMP1942CY/CZ
Reset
Direction Control (bitwise)
Write to PBCR STOP DRIVE
Function Control (bitwise) Internal data bus
Write to PBFC S Output Latch PB0 (TB2IN0/INTB) PB1 (TB2IN1/INTC) PB3 (TB3IN0/INTD) PB4 (TB3IN1/INTE) B
Write to PB
S Selector
Read PB TB2IN0, 1 TB3IN0, 1 INTB, C, D, E
A
Reset
Direction Control (bitwise)
Write to PBCR STOP DRIVE
Function Control (bitwise) Internal data bus
Write to PBFC S Output Latch A Selector Write to PB Timer F/F output (TA3OUT: Timer A3) S B Selector Read PB A B PB6 (TA3OUT)
S
Figure 3.5.26 Port B (PB0, PB1, PB3, PB4, PB6)
TMP1942CY/CZ-94
TMP1942CY/CZ
Reset
Direction Control (bitwise) STOP DRIVE
Write to PBCR
Function Control (bitwise) Internal Data Bus
Write to PBFC S Output Latch PB7 (TA2IN/INT7/KEYB)
Write to PB
S Selector
B
Read PB TA2IN INT7 KEYB DPE Selector A TG B
A
KEYmEN Y PE
fs
Figure 3.5.27 Port B (PB7)
TMP1942CY/CZ-95
TMP1942CY/CZ
Port B Register 7
PB (0xFFFF_F051) Bit Symbol Read/Write After Reset PB7
6
PB6
5
PB5
4
PB4 R/W
3
PB3
2
PB2
1
PB1
0
PB0
Input mode (output latch register set to 1)
Port B Control Register 7
PBCR (0xFFFF_F054) Bit Symbol Read/Write After Reset Function 0 0 0 0 0: IN PB7C
6
PB6C
5
PB5C
4
PB4C W
3
PB3C 0 1: OUT
2
PB2C 0
1
PB1C 0
0
PB0C 0
Input/output settings for port B 0 1 Input Output
Port B Function Register 7
PBFC (0xFFFF_F055) Bit Symbol Read/Write After Reset Function 0 0:PORT 1:TA2IN INT7 KEYB 0 0: PORT 0 0: PORT 0 0: PORT PB7F
6
PB6F
5
PB5F
4
PB4F W
3
PB3F 0 0: PORT 1: INTD TB3IN0
2
PB2F 0 0: PORT
1
PB1F 0 0: PORT
0
PB0F 0 0: PORT 1: INTB TB2IN0
1: TA3OUT 1: TB3OUT 1: INTE TB4IN1 TB3IN1
1: TB2OUT 1: INTC TB4IN0 TB2IN1
Function
Select TB2IN0 input Select INTB input Select TB2IN1 input Select INTC input Select TB2OUT output Select TB4IN0 input Select TB3IN0 input Select INTD input Select TB3IN1 input Select INTE input Select TB3OUT output Select TB4IN1 input Select TA3OUT output Select TA2IN input Select INT7 input Select KEYB input
Corresponding PBFC Bit
1 1 (*1) 1 1 (*1) 1 0 1 1 (*1) 1 1 (*1) 1 0 1 1 1 1
Corresponding PBCR Bit
0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0
Port Used
PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7
(*1) Note:
Set this bit when using the pin for a STOP mode termination interrupt with SYSCR set to 0. Otherwise, the bit need not be set. For a pin to which two or three input functions are assigned in addition to the port function, use the control register for each function module to specify which function is used. Figure 3.5.28 Registers Related to Port B
TMP1942CY/CZ-96
TMP1942CY/CZ 3.5.11 Port C (PC0-PC7)
Port C is an 8-bit general-purpose input/output port whose bits can each be set independently for input or output. The control register PCCR is used to set the port for input or output. A reset clears PCCR to 0, putting port C in input mode. In addition to functioning as an input/output port, the pins of this port can also function as various input/output pins: PC0, PC1 and PC2 function as 8-bit timer input or external interrupt input, PC3 and PC5 as 8-bit timer output, PC6 as 16-bit timer input or key input, PC4 as 8-bit timer input, and PC7 as 16-bit timer input or 8-bit timer output. These functions are enabled by setting the corresponding bits of PCFC to 1. A reset clears PCCR and PCFC to 0, placing port C in input mode. PC6 has a pull-up resistor, which is enabled only when KWUPCNT is set to 1 in the key on wake-up circuit and key input is enabled in KWUPSTn. For details, refer to the description of the key on wake-up function. When the pin is functioning as a port pin, its pull-up resistor is disabled. Port C becomes a 5 V input/output port when 5 V is supplied to its dedicated power supply pin DVCC52. It becomes a VCC-based (3 V) port when VCC is supplied to DVCC52.
Reset
Direction Control (bitwise)
Write to PCCR STOP DRIVE
Function Control (bitwise) Internal data bus
Write to PCFC S Output Latch A Selector Write to PC Timer F/F Output TA5OUT TA7OUT S B Selector Read PC A B PC3 (TA5OUT) PC5 (TA7OUT)
S
Figure 3.5.29 Port C (PC3, PC5)
TMP1942CY/CZ-97
TMP1942CY/CZ
Reset
Direction Control (bitwise)
Write to PCCR STOP DRIVE
Internal Data Bus
Function Control (bitwise)
Write to PCFC S Output Latch PC0 (TA4IN/INT8) PC1 (TA6IN/INT9) PC2 (TA8IN/INTA) S Selector Read PC TA4IN, TA6IN TA8IN INT8, 9, A Reset A B
Write to PC
Direction Control (bitwise) STOP DRIVE
Write to PCCR
Function Control (bitwise) Internal Data Bus
Write to PCFC S Output Latch PC6 (TB8IN0/IN0/KEYC) Reset Write to PC S Selector Read PC TB8IN0 KEYC DPE Selector A TG B KEYmEN Y PE A B
fs
Figure 3.5.30 Port C (PC0, PC1, PC2, PC6)
TMP1942CY/CZ-98
TMP1942CY/CZ
Reset
Direction Control (bitwise)
Write to PCCR STOP DRIVE
Function Control (bitwise) Internal Data Bus
Write to PCFC S Output Latch A Selector Write to PC Timer F/F Output TA9OUT S B Selector Read PC TB8IN1 A B PC7 (TB8IN1/TA9OUT)
S
Reset
Direction Control (bitwise)
Write to PCCR STOP DRIVE
Internal Data Bus
Function Control (bitwise)
Write to PCFC S Output Latch PC4 (TAIN)
Write to PC
S Selector
B
Read PC TAAIN
A
Figure 3.5.31 Port C (PC7, PC4)
TMP1942CY/CZ-99
TMP1942CY/CZ
Port C Register 7
PC (0xFFFF_F058) Bit Symbol Read/Write After Reset PC7
6
PC6
5
PC5
4
PC4 R/W
3
PC3
2
PC2
1
PC1
0
PC0
Input mode (output latch register set to 1)
Port C Control Register 7
PCCR (0xFFFF_F05A) Bit Symbol Read/Write After Reset Function 0 0 0 PC7C
6
PC6C
5
PC5C
4
PC4C W 0 0: IN
3
PC3C 0 1: OUT
2
PC2C 0
1
PC1C 0
0
PC0C 0
Port C Control Register 0 1 Input Output
Port C Function Register 7
PCFC (0xFFFF_F05B) Bit Symbol Read/Write After Reset Function 0 0:PORT 0 0: PORT 0 0: PORT 0 0: PORT PC7F
6
PC6F
5
PC5F
4
PC4F W
3
PC3F 0 0: PORT
2
PC2F 0 0: PORT
1
PC1F 0 0: PORT 1: TA6IN INT9
0
PC0F 0 0: PORT 1: TA4IN INT8
1:TB8IN 1: KEYC TA9OUT TB8IN0
1: TA7OUT 1: TAAIN
1: TA5OUT 1: TA8IN INTA
Function
Select TA4IN input Select INT8 input Select TA6IN input Select INT9 input Select TA8IN input Select INTA input Select TA5OUT output Select TAAIN input Select TA7OUT output Select TB8IN0 input Select KEYC input Select TB8IN1 input Select TA9OUT output
Corresponding PCFC Bit
1 Need not be set 1 Need not be set 1 Need not be set 1 1 1 1 1 1 1
Corresponding PCCR Bit
0 0 0 0 0 0 1 0 1 0 0 0 1
Port Used
PC0 PC1 PC2 PC3 PC4 PC5 PC6 PC7
Note:
For a pin to which two input functions are assigned in addition to the port function, use the control register for each function module to specify which function is used.
Figure 3.5.32 Registers Related to Port C
TMP1942CY/CZ-100
TMP1942CY/CZ 3.5.12 Port D (PD0-PD7)
Port D is an 8-bit general-purpose input/output port whose bits can each be set independently for input or output. The control register PDCR is used to set the port for input or output. A reset clears PDCR to 0, putting port D in input mode. In addition to functioning as an input/output port, the pins of this port can also function as various input/output pins: PD0 and PD3 function as 16-bit timer input or SIO data output, PD1 and PD4 function as 16-bit timer input or SIO data input, PD2 as SIO serial clock input/output or CTS*input, and PD5 as SIO serial clock input/output, CTS*input, or 16-bit timer output. PD6 and PD7 can be connected to a low-frequency oscillator. These functions are enabled by setting the corresponding bits of PDFC1 to 1. For PD5, however, a combination of PDFC1 and PDFC2 determines whether it is used for a port, SIO, or timer. The output open-drain control register (PDODE) can be used to set PD0, PD2, PD3 and PD5 to open-drain output when they are used for output. PD6 and PD7 are always open-drain output when they are used for output. A reset clears PDCR, PDFC1 and PDFC2 to 0, placing port D in input mode.
Reset
Direction Control (bitwise)
Write to PDCR STOP DRIVE
Function Control (bitwise) Internal Data Bus
Write to PDFC S Output Latch
S A Selector PD0 (TB9IN0/TXD0) PD3 (TBAIN0/TXD1)
Write to PD TXD0 TXD1
B
S B Selector Read PD TB9IN0 TBAIN0 A
Figure 3.5.33 Port D (PD0, PD3)
TMP1942CY/CZ-101
TMP1942CY/CZ
Reset
Direction Control (bitwise)
Write to PDCR STOP DRIVE
Function Control (bitwise) Internal Data Bus
Write to PDFC
S Output Latch PD1 (RXD0/TB9IN1) PD4 (RXD1/TBAIN1) S Selector Read PD TB9IN1, TBAIN1 RXD0/1 A
Write to PD
B
Reset
Direction Control (bitwise)
Write to PDCR STOP DRIVE
Function Control (bitwise) Internal Data Bus
Write to PDFC S Output Latch
A
S Selector
PD2 (SCLK0/ CTS0 )
Write to PD SCLK Output
B
Open-drain Setting Possible S Selector B
Read PD
A
CTS0 SCLK0
Figure 3.5.34 Port D (PD1, PD4, PD2)
TMP1942CY/CZ-102
TMP1942CY/CZ
Reset
Direction Control (bitwise)
Write to PDCR STOP DRIVE
Function Control (bitwise)
Internal Data Bus
Write to PDFC S Output Latch S Selector TABOUT Write to PD SCLK1 Output S Selector Read PD CTS1 SCLK1 A B Open-drain Setting Possible PD5 (SCLK1/ CTS1/ TABOUT)
Figure 3.5.35 Port D (PD5) Note: The output mode is selected by a combination of PDFC1 and PDFC2. When PDFC1 = 0 and PDFC2 = 0, port output is selected. When PDFC1 = 1 and PDFC2 = 0, SCLK output is selected. When PDFC1 = 0 and PDFC2 = 1, TABOUT output is selected. Setting both PDFC1 and PDFC2 to 1 is not allowed.
TMP1942CY/CZ-103
TMP1942CY/CZ
Reset S Direction Control (bitwise) Enable Low-frequency Oscillation
Write to PDCR S Output Latch Output Buffer (Open-Drain Output) PD6
Internal Data Bus
Write to PD S B
Y Selector Read PD A
(ON with 1) S Direction Control (bitwise)
Write to PDCR S Output Latch Output Buffer (Open-drain Output) Low-frequency Clock PD7
Write to PD S B
Y Selector Read PD A
Figure 3.5.36 Port D (PD6, PD7)
TMP1942CY/CZ-104
TMP1942CY/CZ
Port D Register 7
PD (0xFFFF_F059) Bit Symbol Read/Write After Reset PD7
6
PD6
5
PD5
4
PD4 R/W
3
PD3
2
PD2
1
PD1
0
PD
Input mode (output latch register set to 1)
Port D Control Register 7
PDCR Bit Symbol After Reset Function PD7C 1 (0xFFFF_F05C) Read/Write 1 0 0: IN 0 1: OUT Input/output settings for port D 0 1 Input Output
6
PD6C
5
PD5C
4
PD4C W
3
PD3C 0
2
PD2C 0
1
PD1C 0
0
PD0C 0
Port D Function Register 1 7
PDFC1 Bit Symbol After Reset Function

6

5
PD5F 0 0: PORT 1: SCLK1/ CTS1*
4
PD4F W 0
3
PD3F 0
2
PD2F 0
1
PD1F 0 0: PORT 1: TB9IN1 RXD0
0
PD0F 0 0: PORT 1: TB9IN0 TXD0
(0xFFFF_F05D) Read/Write
0: PORT 0: PORT 0: PORT 1: TBAIN1 1: TBAIN0 1: SCLK0/ RXD1 TXD1 CTS0*
Port D Function Register 2 7
PDFC2 (0xFFFF_F05E) Bit Symbol Read/Write After Reset Function

6

5
PD5F2 W 0 0: PORT 1: TABOUT
4

3

2

1

0

Port D Open-drain Control Register 7
PDODE (0xFFFF_F05F) Bit Symbol Read/Write After Reset Function

6
5
PDODE5 0 0: CMOS 1: OpenDrain
4
3
PDODE3 W 0 0: CMOS 1: OpenDrain
2
PDODE2 0 0: CMOS 1: OpenDrain
1

0
PDODE0 0 0: CMOS 1: OpenDrain
TMP1942CY/CZ-105
TMP1942CY/CZ
Corresponding PDFC1 Bit
1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
Function
Select TB9IN0 input Select TXD0 output Select TB9IN1 input Select RXD0 input Select SCLK0 input Select SCLK0 output Select CTS0* input Select TBAIN0 input Select TXD1 output Select TBAIN1 input Select RXD1 input Select SCLK1 input Select SCLK1 output Select CTS1 input Select TABOUT output
Corresponding PDFC2 Bit
Need not be set (no bit provided) Need not be set (no bit provided) Need not be set (no bit provided) Need not be set (no bit provided) Need not be set (no bit provided) Need not be set (no bit provided) Need not be set (no bit provided) Need not be set (no bit provided) Need not be set (no bit provided) Need not be set (no bit provided) Need not be set (no bit provided) 0 0 0 1
Corresponding PDCR Bit
0
Port Used
PD0 1 0 PD1 0 0 1 0 0 PD3 1 0 PD4 0 0 1 0 1 PD5 PD2
Note: For a pin to which two input functions are assigned in addition to the port function, use the control register for each function module to specify which function is used.
Figure 3.5.37 Registers Related to Port D
TMP1942CY/CZ-106
TMP1942CY/CZ 3.5.13 Port E (PE0-PE7)
Port E is an 8-bit general-purpose input/output port whose bits can each be set independently for input or output. The control register PECR is used to set the port for input or output. A reset clears PECR to 0, putting port E in input mode. In addition to functioning as an input/output port, the pins of this port can also function as various input/output pins: PE0 and PE3 function as SIO data output, PE1 and PE4 as SIO data input, PE2 and PE5 as SIO CLK input/output or CTS* input, and PE6 and PE7 as external interrupt input. These functions are enabled by setting the corresponding bits of PEFC to 1. A reset clears PECR and PEFC to 0, placing port E in input mode. The output open-drain control register (PEODE) can be used to set PE0, PE2, PE3 and PE5 to open-drain output when they are used for output.
Reset
Direction Control (bitwise)
Write to PECR STOP DRIVE
Function Control (bitwise)
Internal Data Bus
Write to PEFC S Output Latch A S Selector Write to PE TXD3/4 S Selector Read PE A B B Open-drain Setting Possible PE0 (TXD3) PE1 (TXD4)
Figure 3.5.38 Port E (PE0, PE1)
TMP1942CY/CZ-107
TMP1942CY/CZ
Reset
Direction Control (bitwise)
Write to PECR STOP DRIVE
Internal Data Bus
Function Control (bitwise)
Write to PEFC S Output Latch PE1 (RXD3) PE4 (RXD4)
Write to PE
S Selector
B
Read PE RXD1/4
A
Reset
Direction Control (bitwise)
Write to PECR STOP DRIVE
Function Control (bitwise)
Internal Data Bus
Write to PEFC S Output Latch A Write to PE SCLK Output 3 SLK Output 4 S Selector Read PE CTS3*, CTS4* SCLK3, SCLK4 A B S Selector B Open-drain Setting Possible PE2 (SCLK0/ CTS3 ) PE5 (SCLK1/ CTS4 )
Figure 3.5.39 Port E (PE1, PE2, PE4, PE5)
TMP1942CY/CZ-108
TMP1942CY/CZ
Reset Function Control
Direction Control (bitwise)
STOP DRIVE
Write to PECR
Internal Data Bus
S Output Latch Output Buffer Write to PE PE6 (INT1) PE7 (INT2) Reset
Read PE INT1, 2
Figure 3.5.40 Port E (PE6, PE7)
TMP1942CY/CZ-109
TMP1942CY/CZ
Port E Register 7
PE (0xFFFF_F060) Bit Symbol Read/Write After Reset PE7
6
PE6
5
PE5
4
PE4 R/W
3
PE3
2
PE2
1
PE1
0
PE0
Input mode (output latch register set to 1)
Port E Control Register 7
PECR (0xFFFF_F062) Bit Symbol Read/Write After Reset Function 0 0 0 0 0: IN PE7C
6
PE6C
5
PE5C
4
PE4C W
3
PE3C 0 1: OUT
2
PE2C 0
1
PE1C 0
0
PE0C 0
Input/output settings for port E 0 1 Input Output
Port E Function Register 7
PEFC (0xFFFF_F063) Bit Symbol Read/Write After Reset Function 0 0: PORT 1: INT2 0 0: PORT 1: INT1 0 0: PORT 1: SCLK4/ CTS4* 0 0: PORT 1: RXD4 PE7F
6
PE6F
5
PE5F
4
PE4F W
3
PE3F 0 0: PORT 1:ITXD4
2
PE2F 0 0: PORT 1: SCLK3/ CTS3*
1
PE1F 0 0: PORT 1: RXD3
0
PE0F 0 0: PORT 1: TXD3
Port E Open-drain Control Register 7
PEODE (0xFFFF_F066) Bit Symbol Read/Write After Reset Function

6
5
PEODE5 W 0 0: CMOS 1: OpenDrain
4

3
PEODE3 W 0 0: CMOS 1: OpenDrain
2
PEODE2 W 0 0: CMOS 1: OpenDrain
1

0
PEODE0 W 0 0: CMOS 1: OpenDrain
Function
Select TXD3 output Select RXD3 input Select SCLK3 input Select SCLK3 output Select CTS3 input Select TXD4 output Select RXD4 input Select SCLK4 input Select SCLK4 output Select CTS4 input Select INT1 input Select INT2 input
Corresponding PEFC Bit
1 1 1 1 1 1 1 1 1 1 1 (*1) 1 (*1)
Corresponding PECR Bit
1 0 0 1 0 1 0 0 1 0 0 0
Port Used
PE0 PE1 PE2 PE3 PE4 PE5 PE6 PE7
*1 Note:
Set this bit when using the pin for a STOP mode termination interrupt with SYSCR set to 0. Otherwise, the bit need not be set. For a pin to which two input functions are assigned in addition to the port function, use the control register for each function module to specify which function is used. Figure 3.5.41 Registers Related to Port E
TMP1942CY/CZ-110
TMP1942CY/CZ 3.5.14 Port F (PF0-PF6)
Port F is a 7-bit general-purpose input/output port whose bits can each be set independently for input or output. The control register PFCR is used to set the port for input or output. A reset clears PFCR to 0, putting port F in input mode. In addition to functioning as an input/output port, the pins of this port can also function as various input/output pins: PF0 functions as SIO data output, PF1 as SIO data input or key input, PF2 as SIO CLK input/output or CTS* input, PF3, PF4 and PF5 as SBI input/output, and PF6 as external interrupt input. These functions are enabled by setting the corresponding bits of PFFC to 1. A reset clears PFCR and PFFC to 0, placing port F in input mode. The output open-drain control register (PFODE) can be used to set PF0, PF2, PF4 and PF5 to open-drain output when they are used for output. Port F becomes a 5 V input/output port when 5 V is supplied to its dedicated power supply pin DVCC51. It becomes a VCC-based (3 V) port when VCC is supplied to DVCC51.
Reset
Direction Control (bitwise)
Write to PFCR STOP DRIVE
Function Control (bitwise)
Internal Data Bus
Write to PFFC S Output Latch A Write to PF TXD5 S Selector Read PF A B S Selector B Open-drain Setting Possible PF0 (TXD5)
Figure 3.5.42 Port F (PF0)
TMP1942CY/CZ-111
TMP1942CY/CZ
Reset
Direction Control (bitwise) STOP DRIVE
Write to PFCR
Internal Data Bus
Function Control (bitwise)
Write to PFFC S Output Latch PF1 (RXD5/KEYD)
Write to PF
S Selector
B
Read PF RXD5 KEYD DPE
Selector
A
A TG
KEYmEN Y PE
fs
B
Figure 3.5.43 Port F (PF1)
TMP1942CY/CZ-112
TMP1942CY/CZ
Reset
Direction Control (bitwise)
Write to PFCR STOP DRIVE
Function Control (bitwise)
Internal Data Bus
Write to PFFC S Output Latch A S Selector Write to PF SCLK Output S Selector Read PF CTS5* SCLK5 Reset A B B Open-drain Setting Possible PF2 (CLK5/ CTS5 )
Direction Control (bitwise)
Write to PFCR STOP DRIVE
Function Control (bitwise)
Internal Data Bus
Write to PFFC S Output Latch A Write to PF SCLK Output S Selector Read PF SCK Input A B S Selector B PF3 (SCK) Reset
Figure 3.5.44 Port F (PF2, PF3)
TMP1942CY/CZ-113
TMP1942CY/CZ
Reset
Direction Control (bitwise)
Write to PACR STOP DRIVE
Function Control (bitwise)
Internal Data Bus
Write to PAFC S Output Latch A Write to PA SO Output S Selector Read PA SDA Input Reset A B S Selector B Open-drain Setting Possible PF4(SO/SDA) Reset
Direction Control (bitwise)
Write to PACR STOP DRIVE
Function Control (bitwise)
Internal Data Bus
Write to PAFC S Output Latch A Write to PA SO Output S Selector Read PA SI Input SCL Input A B S Selector B Open-drain Setting Possible CDE PF5 (SI/SCL) Reset
Figure 3.5.45 Port F (PF4, PF5)
TMP1942CY/CZ-114
TMP1942CY/CZ
Reset Function Control
Direction Control (bitwise)
STOP DRIVE
Write to PFCR
Internal Data Bus
S Output Latch Output Buffer Reset Write to PF PF6 (INT0)
Read PF INT0
Figure 3.5.46 Port F (PF6)
TMP1942CY/CZ-115
TMP1942CY/CZ
Port F Register 7
PF (0xFFFF_F061) Bit Symbol Read/Write After Reset
6
PF6
5
PF5
4
PF4
3
PF3
2
PF2
1
PF1
0
PF0
R/W Input mode (output latch register set to 1)
Port F Control Register 7
PFCR (0xFFFF_F064) Bit Symbol Read/Write After Reset Function 0 0 0 0 0: IN
6
PF6C
5
PF5C
4
PF4C W
3
PF3C 0 1: OUT
2
PF2C 0
1
PF1C 0
0
PF0C 0
Input/output settings for port F 0 1 Input Output
Port F Function Register 7
PEFC (0xFFFF_F065) Bit Symbol Read/Write After Reset Function

6
PF6F W 0 0: PORT 1: INT0
5
PF5F 0
4
PF4F 0
3
PF3F 0
2
PF2F
1
PF1F 0 0: PORT 1: KEYD RXD5
0
PF0F 0 0: PORT 1: TXD5
0 0: PORT 1: SOLK4 COTS5
0: PORT 0: PORT 0: PORT 1: SI/SCIA 1: SO/SDA 1: SOK
Port F Open-drain Control Register 7
PEODE (0xFFFF_F067) Bit Symbol Read/Write After Reset Function

6
5
PFODE5 W 0 0: CMOS 1: OpenDrain
4
PFODE4

3
2
PFODE2 W 0 0: CMOS 1: OpenDrain
1

0
PFODE0 W 0 0: CMOS 1: OpenDrain
W 0 0: CMOS 1: OpenDrain
Function
Select TXD5 output Select RXD5 input Select KEYD input Select SCLK4 input Select SCLK4 output Select CTS5 input Select SCK output Select SCK input Select SO/SDA Select SI/SCL Select INT0 input
Corresponding PFFC Bit
1 1 1 1 1 1 1 1 1 1 1(*1)
Corresponding PFCR Bit
1 0 0 0 1 0 1 0 1 1 0
Port Used
PF0 PF1
PF2
PF3 PF4 PF5 PF6
*1
Set this bit when using the pin for a STOP mode termination interrupt with SYSCR set to 0. Otherwise, the bit need not be set. For a pin to which two input functions are assigned in addition to the port function, use the Control Register for each function module to specify which function is used. Figure 3.5.47 Registers Related to Port F
Note:
TMP1942CY/CZ-116
TMP1942CY/CZ
3.6
External Bus Interface
The TMP1942 contains an external bus interface function which is necessary for connecting memory or I/Os which are external to the chip. This function is implemented by the external bus interface circuit (EBIF) and the CS (chip select)/wait controller. The CS/wait controller specifies mapping addresses for any four address spaces, and controls a wait state and data bus width (8 bits or 16 bits) for these four address spaces and other external address spaces. The external bus interface circuit (EBIF) controls timing for the external bus based on settings made with the CS/wait controller. The EBIF also controls dynamic bus sizing and the arbitration of bus contention with external bus masters. * Wait function Can be set individually for each block. * * * * A wait state of up to 7 clock cycles can be automatically inserted. Wait states can be inserted from the WAIT pin.
Data bus width The bus width can be independently selected as 8 bits or 16 bits for each block. Read recovery cycle When a external bus cycle is immediately followed by a next external bus cycle, up to two dummy clock cycles can be inserted. Insertion of the dummy cycle(s) can be set individually for each block.
*
Control of ALE width The ALE width can be set to 0.5 or 1.5 clock cycles. The set ALE width applies to all blocks in common.
*
Arbitration of bus contention
TMP1942CY/CZ-117
TMP1942CY/CZ 3.6.1 Address and data pins
(1) Setting address and data pins For external memory connections, port 0 (AD0-AD7), port 1 (AD8-AD15/A8-A15) and port 2 (A16-A23/A0-A7) pins can be used as the address bus and the data bus. One of the following four bus configurations can be selected by setting up the port registers. (1)
Number of address bus lines Number of data bus lines Number of multiplexed address/data bus lines Port function Port 0 Port 1 Port 2 max.24 (~16 MB) 8 8 AD0 ~ AD7 A8 ~ A15 A16 ~ A23
(2)
max.24 (~16 MB) 16 16 AD0 ~ AD7 AD8 ~ AD15 A16 ~ A23
(3)
max.16 (~64 KB) 8 0 AD0 ~ AD7 A8 ~ A15 A0 ~ A7
(4)
max.8 (~256 B) 16 0 AD0 ~ AD7 AD8 ~ AD15 A0 ~ A7
A23~8
A23~8
A23~16
A23~16
A15~0
A15~0 (Note1)
A7~0
A7~0 (Note1)
AD7~0
A7~0
D7~0
AD15~0 A15~0 D15~0
AD7~0
A7~0
D7~0
AD15~0 A15~0 D15~0
Timing diagram
ALE ALE ALE ALE
RD
RD
RD
RD
Note 1: Even for cases (3) and (4), addresses are output because the data bus pins are shared with the address bus. Note 2: Ports 0 to 2 are set for input after a reset, and do not function as address or data bus pins. Note 3: Any one of (1) to (4) can be selected by setting the P1CR, P1FC, P2CR and P2FC registers as desired.
(2) Address hold when an internal area is accessed When an internal area is accessed, the address bus retains the previous address which was output by the external area device; thus the address does not change. In addition, the address/data bus is placed in high-impedance state.
TMP1942-118
TMP1942CY/CZ 3.6.2 External bus operation
This section explains various bus timings. In the following timing diagrams, the address bus is chosen to be A23-A16 and the address/data bus is chosen to be AD15-AD0. (1) Basic bus operation External bus cycles in the TMP1942 essentially consist of three clock cycles. A wait state can be inserted, as will be explained later. The basic clock for external bus cycles is the same as the internal system clock. Figure 3.6.1 shows a read bus timing. Figure 3.6.2 shows a write bus timing. During internal access, the address bus does not change, as shown in the diagram, nor does ALE output a latch pulse. The address/data bus is placed in high-impedance state, and neither RD and WR nor other control signals are asserted.
tsys A [23 : 16] AD [15 : 0] ALE ADR DATA Holds upper address Enter Hi-Z state
Does not output ALE Does not output RD
RD
External access
Internal access
Figure 3.6.1 Read Operation Timing Diagram
tsys A [23 : 16] AD [15 : 0] ALE
WR
Holds upper address Enter Hi-Z state ADR DATA
Does not output ALE Does not output WR
External area
Internal area
Figure 3.6.2 Write Operation Timing Diagram Note: fsys expresses one period of share of system clock.
TMP1942CY/CZ-119
TMP1942CY/CZ
(2) Wait timing Wait cycles can be inserted individually for each block by using the CS/wait controller. The following two types of wait insertion can be used: a. Automatic wait insertion of up to 7 clock cycles b. Wait insertion from WAIT pin Note: "Please set the number of wait as "+1" when you use = long and BUSRQ the ALE width." Timing diagrams with a wait state inserted are shown below.
Wait tsys
A [23 : 16]
Upper address
Upper address
AD [15 : 0] ALE
ADR
DATA
ADR
DATA
RD
0 wait
1 wait
Figure 3.6.3 Read Operation Timing Diagram (with 0 Wait Cycles and 1 Wait Cycle)
Wait tsys
A [23 : 16]
Upper address
Upper address
AD [15 : 0] ALE
RD
ADR
DATA
ADR
DATA
WAIT
0 wait
(1+ N wait, N = 1)
Figure 3.6.4 Read Operation Timing Diagram (1+N Wait Cycles, N = 1)
TMP1942-120
TMP1942CY/CZ
Wait
tsys
A [23 : 16]
Upper address
Upper address
AD [15 : 0]
ADR
DATA
ADR
DATA
ALE
WR
0 wait
1 wait
Figure 3.6.5 Write Operation Timing Diagram (with 0 Wait Cycles and 1 Wait Cycle)
Wait
tsys
A [23 : 16]
Upper address
Upper address
AD [15 : 0]
ADR
DATA
ADR
DATA
ALE
WR
WAIT
0 wait
(1+ N wait, N = 1)
Figure 3.6.6 Write Operation Timing Diagram (1+N Wait Cycles, N = 1)
TMP1942CY/CZ-121
TMP1942CY/CZ
(3) ALE assertion time The ALE assertion time can be selected as either 0.5 or 1.5 clock cycles. The bit for setting this assertion time is provided in the system clock control register. The default assertion time is 1.5 clock cycles. The assertion time cannot be set individually for blocks in the external area; it applies universally to the entire external address space. Note: "Please set the number of wait as "+1" when you use = long and BUSRQ the ALE width."
tsys
ALE (ALESEL = 0) 0.5 clock cycle AD [15 : 0]
(ALESEL = 1) 1.5 clock cycles AD [15 : 0]
Figure 3.6.7 ALE Assertion Time Figure 3.6.8 shows read operation timing with an ALE assertion time of 0.5 clock cycles and that with an ALE assertion time of 1.5 clock cycles.
tsys
A [23 : 16]
Upper address
Upper address
AD [15 : 0]
ADR
DATA
ADR
DATA
ALE
RD
ALE 0.5 clock cycle
ALE 1.5 clock cycles
Figure 3.6.8 Read Operation Timing Diagram (with ALE Asserted for 0.5 and 1.5 Clock Cycles)
TMP1942-122
TMP1942CY/CZ
(4) Read recovery time When an external access occurs after reading from an external area, a dummy cycle can be inserted to create a recovery time. Dummy cycles can only be inserted when the immediately preceding cycle is a read cycle. External read followed by external read: External read followed by external write: Can be inserted Can be inserted
External write followed by external access: Cannot be inserted The number of dummy cycles can be specified independently for each block as one clock cycle or two clock cycles. Use the CS/wait controller to set the number of clock cycles.
tsys
RD
AD [15 : 0]
Read Data
Next ADR
ALE
AD [15 : 0]
Read Data
Next ADR
ALE
Two clock cycles added
Figure 3.6.9 Read Recovery Time As shown above, by adding two dummy clock cycles, a sufficient time from the rise of RD to the output of the next address can be secured even when the device is operating at a fast clock speed. Figure 3.6.10 shows a bus timing diagram where one and two dummy clock cycles are inserted.
Dummy tsys Upper address Dummy
A [23 : 16]
AD [15 : 0]
DATA
ADR
DATA
ADR
ALE
RD
Dummy cycle (1 clock cycle)
Dummy cycles (2 clock cycles)
Figure 3.6.10 Read Operation Timing Diagram (with Dummy Cycles Inserted)
TMP1942CY/CZ-123
TMP1942CY/CZ 3.6.3 Bus arbitration
The TMP1942 allows external bus masters to be connected to the chip. Two signals BUSRQ and BUSAK are used to arbitrate contention for bus control between the processor and external bus masters. External bus masters can only gain control of buses external to the TMP1942. External bus masters cannot gain control of the device's internal bus. (1) Access range for external bus masters External bus masters can only gain control of buses external to the TMP1942. External bus masters cannot gain control of the device's internal bus (G-Bus). Therefore, external bus masters cannot access the device's internal memory and internal I/O blocks. Contention for control of the external bus is arbitrated by the external bus interface circuit (EBIF); hence the CPU and the internal DMAC are not involved in bus arbitration. Even when an external bus master has control of the external bus, the CPU and the internal DMAC can access the internal ROM and RAM and the internal registers. On the other hand, when the CPU or the internal DMAC attempts to access external memory while an external bus master has control of the external bus, the CPU or the internal DMAC is kept waiting until the external bus master finishes control of the external bus. Therefore, if BUSRQ remains asserted for an excessive period of time, the TMP1942 may get locked. (2) Gaining control of the bus An external bus master requests control of the bus from the TMP1942 by asserting the BUSRQ signal. The TMP1942 samples the BUSRQ signal during a break in the external bus cycles on the internal bus (G-Bus) to determine whether or not to grant control of the bus. To give control of the bus to the external bus master, it asserts the BUSAK signal. At the same time, it places the address bus, data bus and bus control signals in high-impedance state. If the data size to be loaded or stored is larger than the width of the bus for the external memory, multiple bus cycles may occur for a single data transfer (bus sizing). In such a case, a break in the external bus cycles will occur when the last bus cycle has finished. The TMP1942 allows the insertion of dummy cycles when external access continues for successive bus cycles. Even in this case it is only when a break in the external bus cycles occurs on the internal bus (G-Bus) that a request for bus control is accepted. During a dummy cycle the next external bus cycle is already activated on the internal bus, so that if the BUSRQ signal is asserted during a dummy cycle, the bus will only be released after the next bus cycle has been completed. Make sure the BUSRQ signal remains asserted until control of the bus has been finished. Figure 3.6.11 shows a timing sequence in which control of the bus is gained by an external bus master.
Note: "Please set the number of wait as "+1" when you use = long and BUSRQ the ALE width."
TMP1942-124
TMP1942CY/CZ
(1)
(2)
(3) tsys
Internal address External address
BUSRQ BUSAK
TMP1942 external access
TMP1942 external access
External bus master cycle
TMP1942 external access
TMP1942 external access
(1) BUSRQ is High. (2) The TMP1942 recognizes that BUSRQ has been pulled Low and releases the bus when the bus cycle has been completed. (3) The TMP1942 asserts BUSAK upon completion of the bus cycle. The external bus master recognizes that BUSAK has been asserted Low and gains control of the bus, thereby initiating its bus operation.
Figure 3.6.11 Timing at Which Control of the Bus is Gained (3) Relinquishing control of the bus An external bus master relinquishes control of the bus in the following case: * When it no longer requires control of the bus
1) Relinquishing control of the bus when an external bus master no longer requires control of the bus. When the external bus master no longer needs the control of the bus which it gained, it deasserts the BUSRQ signal to return control of the bus to the TMP1942. Figure 3.6.12 shows a timing sequence in which the bus is released because the external bus master no longer requires control of it.
(1) (2)(3) tsys
Internal address External address
BUSRQ BUSAK
TMP1942 external access
TMP1942 external access
External bus master cycle TMP1942 external access
TMP1942 external access
(1) The external bus master has control of the bus. (2) Because the external bus master no longer requires control of the bus, it deasserts BUSRQ . (3) The TMP1942 recognizes that BUSRQ has reverted to High and responds by deasserting BUSAK .
Figure 3.6.12 Timing at Which Control of the Bus is Relinquished
TMP1942CY/CZ-125
TMP1942CY/CZ
(4) Bus Release Timings
tsys
Gaddr AD (addr)
Internal
External 2
External 2 Exter-nal 1
Addr
BUSRQ BUSAK
External 1
External 2
BUSRQ asserted during internal access (no external wait)
Gaddr AD (addr)
Internal
External 2
External 2 External 1
Addr
BUSRQ BUSAK
External 1
External 2
BUSRQ asserted during internal access (no external wait)
Gaddr AD (addr)
Internal
External 2
External 2 External 1
Addr
BUSRQ BUSAK
External 1
External 2
BUSRQ asserted during internal access (no external wait)
Note: Gaddr indicates the address on the G-Bus. AD (addr) indicates the address on the address/data bus. Addr indicates the address on the address bus.
TMP1942-126
TMP1942CY/CZ
Gaddr AD (addr)
External 1
External 1
Internal
External 2
External 2 External 1
Addr
BUSRQ BUSAK
External 1
External 2
BUSRQ asserted during external access, followed by internal access (no external wait)
Gaddr AD (addr)
External 1
External 1
Internal
External 2
External 2 External 1
Addr
BUSRQ BUSAK
External 1
External 2
External 3
BUSRQ asserted during external access, followed by internal access (no external wait)
Gaddr AD (addr)
External 1
External 1
External 2
External 2
External 3
External 3 External 1
Addr
BUSRQ BUSAK
External 1
External 2
External 3
BUSRQ asserted during external access, followed by external access (no external wait)
TMP1942CY/CZ-127
TMP1942CY/CZ
Gaddr AD (addr)
External 1
External 1a External 1b
External 2
External 2 External 1
Addr
BUSRQ BUSAK
External 1a
External 1b
External 2
Bus sizing applied (no external wait)
Gaddr
External 1a
External 1
External 1b External 1c External 1d
AD (addr) Addr
BUSRQ BUSAK
External 1a
External 1b
External 1c
External 1d
Bus sizing applied (no external wait)
TMP1942-128
TMP1942CY/CZ
Idle
Gaddr AD (addr)
External 1
External 1
Internal
External 2
External 2 External 1
Addr
BUSRQ BUSAK
External 1
External 2
BUSRQ asserted during external access, followed by internal access (no external wait, 1 idle cycle)
Idle
Gaddr AD (addr)
External 1
External 1
Internal
External 2
External 2 External 1
Addr
BUSRQ BUSAK
External 1
External 2
External 3
BUSRQ asserted during external access, followed by internal access (no external wait, 1 idle cycle)
Idle
Gaddr AD (addr)
External 1 External 1
External 2 External 2
External 3 External 3 External 1
Addr
BUSRQ BUSAK
External 1
External 2
External 3
BUSRQ asserted during external access, followed by external access (no external wait, 1 idle cycle)
TMP1942CY/CZ-129
TMP1942CY/CZ
3.7
Chip Select/Wait Controller
The TMP1942 supports direct connections to external devices (I/O devices, ROM and SRAM). The TMP1942 provides four programmable chip select signals. Programmable features include variable block sizes, data bus width, wait state insertion, and dummy cycle insertion for back-to-back bus cycles.
CS0 - CS3 (multiplexed with P40-P43) are the chip select output pins for the CS0-CS3 address ranges. These
chip select signals are generated when the CPU or on-chip DMAC issues an address within the programmed ranges. The P40-P43 pins must be configured as CS0-CS3 by programming the Port 4 Control (P4CR) register and the Port 4 Function (P4FC) register. Chip select address ranges are defined in terms of a base address and an address mask. There is a Base/Mask Address (BMAn) register for each of the four chip select signals, where n is a number from 0 to 3. There is also a set of three Chip Select/Wait Control registers, B01CS, B23CS and BEXCS, each of which consists of a master enable bit, a data bus width bit, a wait state field and a dummy cycle field. External memory devices can also use the WAIT pin to insert wait states and consequently prolong read and write bus cycles.
3.7.1
Programming Chip Select Ranges
Each of the four chip select address ranges is defined in the BMAn register. The basic chip select model allows one of the chip select output signals ( CS0 - CS3 ) to assert when an address on the address bus falls within a particular programmed range. The B01CS register defines specific operations for CS0 and CS1, and the B23CS register defines specific operations for CS2 and CS3 (see Section 3.7.2).
(1) Base/Mask Address Registers
The organizations of the BMAn registers are shown in Fig.3.7.1 and Fig. 3.7.2. The base address (BAn) field specifies the starting address for a chip select. Any set bit in the address mask field (MAn) masks the corresponding base address bit. The address mask field determines the block size of a particular chip select line. The address is compared on every bus cycle. /Base address The base address (BAn) field specifies the upper 16 bits (A31-A16) of the starting address for a chip select. The lower 16 bits (A15-A0) are assumed to be zero. Thus, the base address is any multiple of 64 Kbytes starting at 0x0000_0000. Figure 3.7.3 shows the relationships between starting addresses and the BMAn values. /Address mask The address mask (MAn) field defines whether any particular bits of the address should be compared or masked. Any set bit masks the corresponding base address bit. The address compare logic uses only the address bits that are not masked (i.e., mask bit cleared to 0) to detect an address match. Address bits that can be masked (i.e., supported block sizes) differ for the four chip select spaces as follows: CS0 and CS1 spaces: A29-A14 CS2 and CS3 spaces: A30-A15 Note: Use physical addresses in the BMAn registers.
TMP1942-130
TMP1942CY/CZ
Base/mask address registers BMA0 (0xFFFF_E400) to BMA3 (0xFFFF_E40C)
7 BMA0 (0xFFFF_E400) Bit symbol Read/Write After reset Function 15 Bit symbol Read/Write After reset Function 23 Bit symbol Read/Write After reset Function 31 Bit symbol Read/Write After reset Function 7 BMA1 (0xFFFF_E404) Bit symbol Read/Write After reset Function 15 Bit symbol Read/Write After reset Function 23 Bit symbol Read/Write After reset Function 31 Bit symbol Read/Write After reset Function 0 0 0 0 30 0 0 0 29 0 28 BA1 R/W 0 0 0 0 Sets A31-A24 for the start address. 22 0 0 0 21 0 20 BA1 R/W 0 27 0 26 0 25 0 24 Sets A23-A16 for the start address. 1 1 14 1 13 1 12 MA1 R/W 0 19 0 18 1 17 1 16 Must always be set to 0. 6 5 0 0 0 0 30 0 0 0 29 0 28 BA0 R/W 0 0 0 0 Sets A31-A24 for the start address. 4 MA1 R/W 1 11 1 10 1 9 1 8 Sets the size of the CS1 space. 0: Used for comparing addresses 3 2 1 0 22 0 0 0 21 0 20 BA0 R/W 0 27 0 26 0 25 0 24 Sets A23-A16 for the start address. 1 1 14 1 13 1 12 MA0 R/W 0 19 0 18 1 17 1 16 Must always be set to 0. 6 5 4 MA0 R/W 1 11 1 10 1 9 1 8 Sets the size of the CS0 space. 0: Used for comparing addresses 3 2 1 0
Note: Bits 10-15 in BMA0 and BMA1 must always be set to 0. This is because, although the CS0 and CS1 spaces can have a size of 16 KB to 1 GB, the TMP1942's external address space is limited to 16 MB, which requires setting bits 10-15 to 0 so as not to mask the A24-A29 address bits. Figure 3.7.1 Base/Mask Address Registers (BMA0 and BMA1)
TMP1942CY/CZ-131
TMP1942CY/CZ
7 BMA2 (0xFFFF_E408) Bit symbol Read/Write After reset Function 15 Bit symbol Read/Write After reset Function 23 Bit symbol Read/Write After reset Function 31 Bit symbol Read/Write After reset Function 7 BMA3 (0xFFFF_E40C) Bit symbol Read/Write After reset Function 15 Bit symbol Read/Write After reset Function 23 Bit symbol Read/Write After reset Function 31 Bit symbol Read/Write After reset Function 0 0 0 0 30 0 0 0 29 0 28 BA3 R/W 0 0 0 0 Sets A31-A24 for the start address. 22 0 0 0 21 0 20 BA3 R/W 0 27 0 26 0 25 0 24 Sets A23-A16 for the start address. 1 1 14 1 13 1 12 MA3 R/W 0 19 0 18 0 17 1 16 Must always be set to 0. 6 5 0 0 0 0 30 0 0 0 29 0 28 BA2 R/W 0 0 0 0 Sets A31-A24 for the start address. 4 MA3 R/W 1 11 1 10 1 9 1 8 Sets the size of the CS2 space. 0: Used for comparing addresses 3 2 1 0 22 0 0 0 21 0 20 BA2 R/W 0 27 0 26 0 25 0 24 Sets A23-A16 for the start address. 1 1 14 1 13 1 12 MA2 R/W 0 19 0 18 0 17 1 16 Must always be set to 0. 6 5 4 MA2 R/W 1 11 1 10 1 9 1 8 Sets the size of the CS2 space. 0: Used for comparing addresses 3 2 1 0
Note: Bits 9-15 in BMA2 and BMA3 must always be set to 0. This is because, although the CS2 and CS3 spaces can have a size of 32 KB to 2 GB, the TMP1942's external address space is limited to 16 MB, which requires setting bits 9-15 to 0 so as not to mask the A24-A30 address bits. Figure 3.7.2 Base/Mask Address Registers (BMA2 and BMA3)
TMP1942-132
TMP1942CY/CZ
Address 0xFFFF_FFFF
Start address 0xFFFF_0000
Base address value (BAn) FFFF
0x0006_0000 0x0005_0000 0x0004_0000 0x0003_0000 0x0002_0000 0x0001_0000 0x0000_0000 64 Kbytes 0x0000_0000
0006 0005 0004 0003 0002 0001 0000
Figure 3.7.3 Relationship Between Start Address and Base Address Register Values (2) Setting the start address and address space size * Program the BMA0 register as follows to cause CS0 to be asserted in the 64 Kbytes of address space starting at 0xC000_0000.
31 BA0 C 0 0 0 0 0 16 15 MA0 0 3 0
11000000000000000000000000000011
BMA0 Register Value
The BA0 field specifies the upper 16 bits of the starting address, or 0xC000. The MA0 field determines whether the A29-A14 bits of the address should be compared or masked. The A31 and A30 bits are always compared. Bits 15-10 of the MA0 field must be cleared so that the A29-A24 bits are always compared. When the BMA0 register is programmed as shown above, the A31-A16 bits of the address are compared to the value of the BA0 field. Consequently, the 64-Kbyte address range between 0xC000_0000 and 0xC000_FFFF is defined as the CS0 space.
TMP1942CY/CZ-133
TMP1942CY/CZ
*
Program the BMA2 register as follows to cause CS2 to be asserted in the 512 Kbyte of address space starting at 0x1FC8_0000.
31 BA2 MA2 00011111110100000000000000011111 1 F D 0 0 0 1 F 16 15 0
BMA2 Register Value
The BA2 field specifies the upper 16 bits of the starting address, or 0x1FC8. The MA2 field determines whether the A30-A15 bits of the address should be compared or masked. The A31 bit is always compared. Bits 15-9 of the MA0 field must be cleared so that the A30-A24 bits are always compared. When the BMA2 register is programmed as shown above, the A31-A19 bits of the address are compared to the value of the BA2 field. Consequently, the 1-Mbyte address range between 0x1FC8_0000 and 0x1FCF_FFFF is defined as the CS2 space.
Note: The TMP1942 does not assert any CSn signal in the following address ranges: 0xFFFF_8000 through 0x1FFF_BFFF
Upon reset, the CS0, CS1 and CS3 spaces are disabled while the CS2 space is enabled and spans the entire 4-GB address space.
TMP1942-134
TMP1942CY/CZ
(3) Specifying the size of an address space
Table 3.7.1 shows the possible sizes of each CS space. If two or more address spaces are specified which overlap one another, the address space with the lowest CS space number will be selected since it has priority.
Example: The start address of the CS0 space is 0xC000_0000 and the space size is 16 Kbytes. The start address of the CS1 space is 0xC000_0000 and the space size is 64 Kbytes.
CS0 space CS1 space 0xC000_FFFF
0xC000_3FFF 0xC000_0000
0xC000_3FFF 0xC000_0000
When an address within the range of 0xC000_0000 to 0xC000_3FFF is accessed, the CS0 space is selected.
Table 3.7.1 CS Spaces and Their Possible Sizes
Size (Bytes) CS Space
CS0 CS1 CS2 CS3
16 K
32 k
64 K 128 K 256 K 512 K
1M
2M
4M
8M
16 M
TMP1942CY/CZ-135
TMP1942CY/CZ 3.7.2 Chip select/wait control registers
The chip select/wait control registers are shown in Figure 3.7.4 to Figure 3.7.6. For each address space (i.e., the CS0-CS3 spaces and any other address space), the corresponding chip select/wait control register (B01CS-B23CS or BEXCS) can be used to enable/disable the master, select a chip select output waveform and data bus width, set the number of wait cycles and insert dummy cycles. If two or more address spaces are specified which overlap one another, the address space with the lowest CS space number will be selected since it has priority. (The priority order is CS0 > CS1 > CS2 > CS3 > EXCS.) B01CS (0xFFFF_E480), B23CS (0xFFFF_E484), BEXCS (0xFFFF_E488)
7 B01CS (0xFFFF_E480) 6 B0OM W 0 0 Selects chip select output waveform. 00: ROM/RAM Other settings are not allowed. 5 0 Selects data bus width. 0: 16 bits 1: 8 bits 0 4 B0BUS W 1 0 1 0010: 2 cycles Sets the number of wait cycles 0000: 0 cycles 0001: 1 cycle 0110: 6 cycles 0111: 7 cycles 1111: (1+N) cycles Other settings are not allowed. 11 B0E W 0 CS0 enable 0: Disable 1: Enable 10 0 9 8 B0RCV 0 Sets the number of dummy cycles to be inserted. (Read recovery time) 00: 2 cycles 01: 1 cycle 10: None 11: Setting not allowed 23 22 B1OM W 0 0 Selects chip select output waveform. 00: ROM/RAM Other settings are not allowed. 21 0 Selects data bus width. 0: 16 bits 1: 8 bits 0 20 B1BUS W 1 0 1 0010: 2 cycles Sets the number of wait cycles 0000: 0 cycles 0001: 1 cycle 0110: 6 cycles 0111: 7 cycles 1111: (1+N) cycles Other settings are not allowed. 27 B1E W 0 CS1 enable 0: Disable 1: Enable 26 0 25 B1RCV W 0 Sets the number of dummy cycles to be inserted. (Read recovery time) 00: 2 cycles 01: 1 cycle 10: None 11: Setting not allowed 24 0011: 3 cycles 0100: 4 cycles 0101: 5 cycles 0011: 3 cycles 0100: 4 cycles 0101: 5 cycles 3 2 B0W 1 0
Bit symbol Read/Write
After reset Function
15
14
13
12
Bit symbol Read/Write
After reset Function

19
18
B1W
17
16
Bit symbol Read/Write
After reset Function
31
30
29
28
Bit symbol Read/Write
After reset Function

Figure 3.7.4 Chip select/wait control registers Note: "Please set the number of wait as "+1" when you use = long and BUSRQ the ALE width."
TMP1942-136
TMP1942CY/CZ
7 B23CS (0xFFFF_E484) Bit symbol Read/Write After reset Function 0 B2OM W
6
5
4 B2BUS
3
2 B2W W
1
0
0
0 Selects data bus width. 0: 16 bits 1: 8 bits
0
1
0
1 0010: 2 cycles
Selects chip select output waveform. 00: ROM/RAM Other settings are not allowed.
Sets the number of wait cycles 0000: 0 cycles 0001: 1 cycle 0110: 6 cycles 0111: 7 cycles 1111: (1+N) cycles Other settings are not allowed. 11 B2E 1 CS2 enable 0: Disable 1: Enable 10 B2M W 0 Selects CS2 space. 0 0 Sets the number of dummy cycles to be inserted. 9 B2RCV 8 0011: 3 cycles 0100: 4 cycles 0101: 5 cycles
15 Bit symbol Read/Write After reset Function
14
13
12
0: 4-Gbyte (Read recovery time) space 00: 2 cycles 1: CS 01: 1 cycle space 10: None 11: Setting not allowed 18 B3W W 17 16
23 Bit symbol Read/Write After reset Function 0 B3OM W
22
21
20 B3BUS 0 Selects data bus width. 0: 16 bits 1: 8 bits
19
0
0
1
0
1 0010: 2 cycles
Selects chip select output waveform. 00: ROM/RAM Other settings are not allowed.
Sets the number of wait cycles 0000: 0 cycles 0001: 1 cycle 0110: 6 cycles 0111: 7 cycles 1111: (1+N) cycles Other settings are not allowed. 27 B3E W 0 CS3 enable 0: Disable 1: Enable 26 0 25 B3RCV W 0 Sets the number of dummy cycles to be inserted. (Read recovery time) 00: 2 cycles 01: 1 cycle 10: None 11: Setting not allowed 24 0011: 3 cycles 0100: 4 cycles 0101: 5 cycles
31 Bit symbol Read/Write After reset Function
30
29
28
Note: The initial value of B23CS is 1 when AM = High and 0 when AM = Low. Figure 3.7.5 Chip select/wait control registers Note: "Please set the number of wait as "+1" when you use = long and BUSRQ the ALE width."
TMP1942CY/CZ-137
TMP1942CY/CZ
7 BEXCS (0xFFFF_E488) Bit symbol Read/Write After reset Function 0 BEXOM W 0 Selects chip select output waveform. 00: ROM/RAM Other settings are not allowed. 15 Bit symbol Read/Write After reset Function 14 13 6 5 0 Selects data bus width. 0: 16 bits 1: 8 bits 12 11 10 0 9 BEXRCV W 0 Sets the number of dummy cycles to be inserted. (Read recovery time) 00: 2 cycles 01: 1 cycle 10: None 11: Setting not allowed 8 0 4 BEXBUS W 1 0 1 Sets the number of wait cycles 0000-0111: 0 cycles to 7 cycles 1111: (1+N) cycles Other settings are not allowed. 3 2 BEXW 1 0
Figure 3.7.6 Chip select/wait control registers Note: "Please set the number of wait as "+1" when you use = long and BUSRQ the ALE width."
3.7.3
Example of Use
Figure 3.7.7 shows an example of a TMP1942 system configuration with external memory connected. In this example a 128-Kbyte ROM is connected with a data width of 16 bits and 256-Kbyte RAM is connected with a data width of 16 bits.
TMP1942
A16 - 17 AD8 - 15
Latch x 16 A16 A1 - 15
ROM (128 Kbits x 16) A15 A0 - 14
OE CE
DQ AD0 - 7 ALE
CS2
D8 - 15 D0 - 7
LE
RAM (128 Kbits x 8) A16 - 17 A1 - 15 A15 - 16 A0 - 14
OE
R/ W
I/01 - 8 Upper byte
RD HWR
CE1 CS1
WR
A16 - 17 A1 - 15
RAM (128 Kbits x 8) A15 - 16 A0 - 14
OE
I/01 - 8 Lower byte
AM1 AM0
R/ W CE1
Figure 3.7.7 Example of External Memory Connection (ROM width = 16 bits, RAM width = 16 bits) When the TMP1942 is reset, the port 4 control register (P4CR) and port 4 function register (P4FC) are both cleared to 0, so that the CS signal output is disabled. To output a CS signal from this port, set the corresponding bits in these registers to 1, first in P4FC and then in P4CR.
TMP1942-138
TMP1942CY/CZ
3.8
DMA Controller (DMAC)
The TMP1942 incorporates a four-channel DMA controller.
3.8.1
Features
The DMAC included in the TMP1942 has the following features: (1) Independent 4-channel DMA (2) Two types of request for control of the bus: with snoop request or without snoop request (3) Transfer request: Internal transfer request: Start by software External transfer request: Request by interrupt (4) Transfer mode: (6) Device size: Dual-address mode 32 bits for memory (16 or 8 bits can also be specified using the CS/wait controller); 8, 16 or 32 bits for I/O (5) Transfer devices: Memory-to-memory, memory-to-I/O, I/O-to-memory
(7) Address change: Increment, decrement, fixed, irregular increment or irregular decrement (8) Channel priority: Fixed
TMP1942CY/CZ-139
TMP1942CY/CZ
3.8.2
Configuration
Internal connections in the TMP1942
3.8.2.1
Figure 3.8.1 shows how the DMAC is connected internally within the TMP1942.
INTDREQ [3 : 0]* DACK [3 : 0]* TX19 processor core Interrupt controller
External interrupt request Internal I/O interrupt request
Indicate bus control relinquished
DMAC
BUSGNT
*
Bus control request Request release of bus control Indicate bus control granted Control Address Data
BUSREQ *
BUSREL *
HAVEIT *
Note * : internal signal
Figure 3.8.1 Internal Connection of DMAC Within the TMP1942 The DMAC has four DMA channels. These channels each receive a data transfer request signal (INTDREQn) from the interrupt controller and return an acknowledge signal ( DACKn ) in response to INTDREQn. The letter `n' denotes the channel number: 0 to 3. Channel 0 has priority over channel 1, channel 1 has priority over channel 2 and channel 2 has priority over channel 3. The TX19 processor core has a snoop function. The snoop function entails the TX19 processor core releasing the core data bus to the DMAC so that the DMAC can access the internal ROM or internal RAM connected to the TX19 processor core. The DMAC can choose whether or not to use the snoop function. For details of the snoop function, refer to Section 3.8.2.3, "Snoop function". There are two types of request for bus control: SREQ and GREQ. The type which is selected depends on whether or not the DMAC is using the snoop function. GREQ is used to request control of the bus when the snoop function is not in use and SREQ is used to request control of the bus when the snoop function is in use. An SREQ bus request has higher priority than a GREQ bus request.
Note : DMA channel priority exists only among those using the same type of bus request signal(SREQ or GREQ).For example, once a given DMA channel has acquired bus mastership using SREQ, no other DMA channel can assume bus mastership using GREQ until the ongoing DMA transaction is completed.
TMP1942CY/CZ-140
TMP1942CY/CZ
3.8.2.2 Internal blocks of the DMAC Figure 3.8.2 shows the internal blocks of the DMAC.
Channel 3 Channel 2 Channel 1 31 Channel 0 31 0 Source Regisuter - 0
Source address register (SAR0) Byte Count Destination - address register (DAR0) Byte count register (BCR0) Status Channel control register (CCR0) Channel status register (CSR0) DMA transfer control register (DTCR0)
DMA control register(DCR) Data holding register(DHR)
Figure 3.8.2 Internal Blocks of the DMAC 3.8.2.3 Snoop function The TX19 processor core has a snoop function. This function is used to release the TX19 processor core's data bus to the DMAC. When the snoop function is activated, the TX19 processor core releases its data bus to the DMAC. At the same time the TX19 processor core stops operating and remains idle until control of the data bus is returned to it by the DMAC. Since the DMAC can access the processor's internal RAM or internal ROM while the snoop function is active, the RAM or ROM can be specified as the source or destination of a transfer. The TMP1942's internal DMAC can select whether or not to use the TX19 processor core's snoop function. If the DMAC chooses to use the snoop function, it can then access the processor's internal RAM and internal ROM. The CPU in the TX19 processor core will then be stalled until the DMAC cancels the bus request. If the DMAC chooses not to use the snoop function, it cannot access the processor's internal RAM or internal ROM. However, since in this case too the G-Bus is released to the DMAC, if the TX19 processor core attempts to access memory or I/O via the G-Bus and the DMAC does not respond to the request for release of bus control, the TX19 processor core will not be able to execute bus operation, and as a result the pipeline will stall. Note: When the snoop function is not used, the TX19 processor core does not release the data bus to the DMAC. Therefore, if the processor's internal RAM or internal ROM is specified as the source or destination of a DMA transfer, no acknowledge signal will be returned for the DMAC's transfer cycle, resulting in the bus being locked.
TMP1942CY/CZ-141
TMP1942CY/CZ 3.8.3 Registers
The DMAC incorporates twenty-six 32-bit registers. Table 3.8.1 shows the DMAC register map. Table 3.8.1 DMAC Registers Address
0xFFFF_E200 0xFFFF_E204 0xFFFF_E208 0xFFFF_E20C 0xFFFF_E210 0xFFFF_E218 0xFFFF_E220 0xFFFF_E224 0xFFFF_E228 0xFFFF_E22C 0xFFFF_E230 0xFFFF_E238 0xFFFF_E240 0xFFFF_E244 0xFFFF_E248 0xFFFF_E24C 0xFFFF_E250 0xFFFF_E258 0xFFFF_E260 0xFFFF_E264 0xFFFF_E268 0xFFFF_E26C 0xFFFF_E270 0xFFFF_E278 0xFFFF_E280 0xFFFF_E28C
Register Symbol
CCR0 CSR0 SAR0 DAR0 BCR0 DTCR0 CCR1 CSR1 SAR1 DAR1 BCR1 DTCR1 CCR2 CSR2 SAR2 DAR2 BCR2 DTCR2 CCR3 CSR3 SAR3 DAR3 BCR3 DTCR3 DCR DHR
Register Name
Channel control register (ch. 0) Channel status register (ch. 0) Source address register (ch. 0) Destination address register (ch. 0) Byte count register (ch. 0) DMA transfer control register (ch. 0) Channel control register (ch. 1) Channel status register (ch. 1) Source address register (ch. 1) Destination address register (ch. 1) Byte count register (ch. 1) DMA transfer control register (ch. 1) Channel control register (ch. 2) Channel status register (ch. 2) Source address register (ch. 2) Destination address register (ch. 2) Byte count register (ch. 2) DMA transfer control register (ch. 2) Channel control register (ch. 3) Channel status register (ch. 3) Source address register (ch. 3) Destination address register (ch. 3) Byte count register (ch. 3) DMA transfer control register (ch. 3) DMA control register (DMAC) Data-holding register (DMAC)
TMP1942CY/CZ-142
TMP1942CY/CZ
3.8.3.1
31 Rst W 0 15 30
DMA control register (DCR)
16
: Type : Initial value 0
: Type : Initial value
Bit
31
Mnemonic
Rst
Field Name
Reset Reset (initial value: --)
Description
Resets the DMAC by software. When the Rst bit is set to 1, all of the DMAC's internal registers are reset to their initial values. Also, all transfer requests are canceled and the four DMA channels are turned off. 0: Don't care 1: Initialize the DMAC.
Figure 3.8.3 DMA Control Register (DCR)
Note1: When the snoop request is disabled (CCRn.SReq=0), a software reset of the DMAC must be performed in the following sequence: 1. Disable interrupts. 2. Execute NOP four times. 3. Perform a software reset. 4. Perform a software reset again. 5. Re-enable interrupts. Execute steps 3 and 4 consecutively. Note 2: If the software reset command is written to the DCR register immediately after the completion of the last transfer cycle of a DMA transaction, the DMA-done interrupt will not be cleared. In this case, the software reset only initializes channel registers, etc. Note 3: Don't issue a software reset command to the DCR register via a DMA transfer.
TMP1942CY/CZ-143
TMP1942CY/CZ
3.8.3.2
31 Str W 0 15 -- R/W 0 14 ExR R/W 0 13 PosE R/W 0 30
Channel control registers (CCRn)
25 0 24 -- W 23 NIEn R/W 1 7 SAC R/W 00 22 AbIEn R/W 1 6 DIO R/W 0 21 -- R/W 1 5 DAC R/W 00 20 -- R/W 0 4 19 -- R/W 0 3 TrSiz R/W 00 18 -- R/W 0 2 17 Big R/W 1 1 DPS R/W 00 : Type : Initial value 16 -- R/W : Type 0 : Initial value 0
12 Lev R/W 0
11
10
9 SIO R/W 0
8
SReq RelEn R/W 0 R/W 0
Bit
31
Mnemonic
Str
Field Name
Channel Start Start (initial value: --)
Description
Starts channel operation. When this bit is set to 1, the channel enters ready state. Data transfer can now commence as soon as a transfer request is received. 1 is the only valid value which can be written to this bit; if a 0 is written, it is ignored. When read, this bit always appears to be 0. 1: Start channel operation.
24 23
NIEn
(Reserved) Normal Completion Interrupt Enable Abnormal Completion Interrupt Enable (Reserved) (Reserved) (Reserved) (Reserved) Big-Endian
This bit is reserved. Make sure that it is always set to 0. Normal Completion Interrupt Enable (initial value: 1) 1: Enable normal completion interrupts. 0: Disable normal completion interrupts. Abnormal Completion Interrupt Enable (initial value 1) 1: Enable abnormal completion interrupts. 0: Disable abnormal completion interrupts. This bit is reserved. Although this bit is initially set to 1, make sure that it is always set to 0. This bit is reserved. Make sure that it is always set to 0. This bit is reserved. Make sure that it is always set to 0. This bit is reserved. Make sure that it is always set to 0. Big-Endian (initial value: 1) 1: The channel operates in big endian mode. 0: The channel operates in little endian mode. On the TMP1942, set this bit to 0.
22
AbIEn
21 20 19 18 17
Big
16 15 14
ExR
(Reserved) (Reserved)
This bit is reserved. Make sure that it is always set to 0. This bit is reserved. Make sure that it is always set to 0. Specifies the transfer request mode. 1: External transfer request (interrupt-driven start) 0: Internal transfer request (soft start)
External Request Mode External Request Mode (initial value: 0)
13
PosE
Positive Edge
Positive Edge (initial value: 0) Specifies the valid level for the transfer request signal INTDREQn. This specification is effective only when the transfer request is an external transfer request (i.e., when the ExR bit = 1). In the case of internal transfer requests (i.e., when the ExR bit = 0) the value of PosE is ignored. Be sure to set the PosE bit to 0 and the adjacent Lev bit to 1 .
Figure 3.8.4 Channel Control Registers (CCRn) (1/2)
TMP1942CY/CZ-144
TMP1942CY/CZ
Bit
12
Mnemonic
Lev
Field Name
Level Mode
Description
Level Mode (initial value: 0) Specifies the method for requesting external transfer. This specification is effective only when the transfer request is an external transfer request (i.e., when the ExR bit = 1). In the case of internal transfer requests (i.e., when the ExR bit = 0), the value of Lev is ignored. Be sure to set the Lev bit to 1.
11
SReq
Snoop Request
Snoop Request (initial value: 0) Specifies whether or not the snoop function is to be used as the bus control request mode. When the function is selected for use, the TX19 processor core's snoop function is activated with the result that the DMAC can use the processor core's data bus. When the function is not selected for use, the TX19 processor core's snoop function remains inactive. 1: The snoop function is used (i.e., the device is in SREQ mode). 0: The snoop function is not used (i.e., the device is in GREQ mode).
10
RelEn
Bus Control Release Request Enable
Release Request Enable (initial value: 0) Specifies whether the DMAC will respond to requests for release of bus control issued from the TX19 processor core. This function is only effective in GREQ mode. In SREQ mode, this function would have no effect since the TX19 processor core cannot generate a request for release of bus control. 1: After the DMAC has taken over bus control, it will respond to requests for release of bus control. When the TX19 processor core issues a request for release of bus control, the DMAC will return control of the bus to the TX19 processor core when a break in bus operation occurs. 0: The DMAC will not respond to requests for release of bus control.
9
SIO
Source I/O
Source Type: I/O (initial value: 0) Specifies the source device from which to perform transfer. 1: I/O device 0: Memory
8:7
SAC
Source Address Count
Source Address Count (initial value: 00) Specifies the way in which the source address changes. 1x: The address is fixed. 01: The address is decremented. 00: The address is incremented.
6
DIO
Destination I/O
Destination Type: I/O (initial value: 0) Specifies the destination device to which to perform transfer. 1: I/O device 0: Memory
5:4
DAC
Destination Address Count
Destination Address Count (initial value: 00) Specifies the way in which the destination address changes. 1x: The address is fixed. 01: The address is decremented. 00: The address is incremented.
3:2
TrSiz
Transfer Size
Transfer Size (initial value: 00) Indicates the amount of data to be transferred in response to one transfer request. 11: 8 bits (1 byte) 10: 16 bits (2 bytes) 0x: 32 bits (4 bytes)
1:0
DPS
Device Port Size
Device Port Size (initial value: 00) Specifies the bus width for the I/O device which has been specified as the source or destination device. 11: 8 bits (1 byte) 10: 16 bits (2 bytes) 0x: 32 bits (4 bytes)
Figure 3.8.4 Channel Control Registers (CCRn) (2/2)
TMP1942CY/CZ-145
TMP1942CY/CZ
3.8.3.3
31 Act R 0 15
Channel status registers (CSRn)
23 0 NC R/W 0 22 AbC R/W 0 21 -- R/W 0 20 BES R 0 19 BED R 0 3 0 18 Conf R 0 2 -- -- R/W 000 0 ---- : Type : Initial value 00 : Type : Initial value 16
Bit
31
Mnemonic
Act
Field Name
Channel Active
Description
Channel Active (initial value: 0) Indicates whether the channel is in ready state. 1: Channel is in ready state. 0: Channel is not in ready state.
23
NC
Normal Completion
Normal Completion (initial value: 0) Indicates whether channel operation has terminated normally. If normal completion interrupts have been enabled by the CCR register, the DMAC generates an interrupt request when this bit is set to 1. The NC bit can be cleared by writing a 0 to it. If a normal completion interrupt has been requested, the interrupt request is dropped when the NC bit is set to 0. If an attempt is made to set the Str bit to 1 while the NC bit = 1, an error results. Be sure to clear the NC bit to 0 before starting the next transfer. Writing a 1 to this bit has no effect. 1: Channel operation has terminated normally. 0: Channel operation has not terminated normally.
22
AbC
Abnormal Completion
Abnormal Completion (initial value: 0) Indicates whether channel operation has terminated abnormally. If abnormal completion interrupts have been enabled by the CCR register, the DMAC generates an interrupt request when this AbC bit is set to 1. The AbC bit can be cleared by writing a 0 to it. If an abnormal completion interrupt has been requested, the interrupt request is cancelled when the AbC bit is set to 0. When the AbC bit is cleared, the BES, BED and Conf bits are also cleared to 0. If an attempt is made to set the Str bit to 1 while the AbC bit = 1, an error results. Be sure to clear the AbC bit to 0 before starting the next transfer. Writing a 1 to this bit has no effect. 1: Channel operation has terminated abnormally. 0: Channel operation has not terminated abnormally.
21 20
BES
(Reserved) Source Bus Error
This bit is reserved. Make sure that it is always set to 0. Source Bus Error (initial value: 0) 1: A bus error has occurred while the source was being accessed. 0: No bus error has occurred while the source was being accessed.
19
BED
Destination Bus Error
Destination Bus Error (initial value: 0) 1: A bus error has occurred while destination was being accessed. 0: No bus error has occurred while destination was being accessed.
18
Conf
Configuration Error
Configuration Error (initial value: 0) 1: A configuration error has occurred. 0: No configuration error has occurred.
2:0
(Reserved)
These three bits are all reserved. Always set all of these bits to 0.
Figure 3.8.5 Channel Status Registers (CSRn)
TMP1942CY/CZ-146
TMP1942CY/CZ
3.8.3.4
31 SAddr R/W -- 15 SAddr R/W -- : Type : Initial value 0 : Type : Initial value
Source address registers (SARn)
16
Bit
31:0
Mnemonic
SAddr
Field Name
Source Address
Description
Source Address (initial value: --) Sets the physical source address from which data will be transferred. After each transfer the address will change by the value specified in the DPS bits of the CCRn register.
Figure 3.8.6 Source Address Registers (SARn)
3.8.3.5
31
Destination address registers (DARn)
16 DAddr R/W -- : Type : Initial value 0 DAddr R/W -- : Type : Initial value
15
Bit
31:0
Mnemonic
DAddr
Field Name
Destination Address
Description
Destination Address (initial value: --) Sets the physical destination address to which data will be transferred. After each transfer the address will change by the value specified in the DPS bits of the CCRn register.
Figure 3.8.7 Destination Address Registers (DARn)
TMP1942CY/CZ-147
TMP1942CY/CZ
3.8.3.6
31 0
Byte count registers (BCRn)
24 23 BC R/W -- : Type : Initial value 0 BC R/W -- : Type : Initial value 16
15
Bit
23:0
Mnemonic
BC
Field Name
Byte count
Description
Byte Count (initial value: --) Sets the number of bytes of data to be transferred. The amount by which the byte count is decremented after each transfer depends on the value specified in the TrSiz bits of the CCRn register.
Figure 3.8.8 Byte Count Registers (BCRn)
3.8.3.7
31
DMA transfer control registers (DTCRn)
24 0 : Type : Initial value 23 16
15 0
5 DACM R/W 000
3
2 SACM
0
000
: Type : Initial value
Bit
5:3
Mnemonic
DACM
Field Name
Destination Address Count Mode
Description
Destination Address Count Mode Specifies the mode used for counting the destination address. 000: Count the address beginning at bit 0 of the address counter. 001: Count the address beginning at bit 4 of the address counter. 010: Count the address beginning at bit 8 of the address counter. 011: Count the address beginning at bit 12 of the address counter. 100: Count the address beginning at bit 16 of the address counter. 101: Reserved 110: Reserved 111: Reserved
2:0
SACM
Source Address Count Mode
Source Address Count Mode Specifies the mode used for counting the source address. 000: Count the address beginning at bit 0 of the address counter. 001: Count the address beginning at bit 4 of the address counter. 010: Count the address beginning at bit 8 of the address counter. 011: Count the address beginning at bit 12 of the address counter. 100: Count the address beginning at bit 16 of the address counter. 101: Reserved 110: Reserved 111: Reserved
Figure 3.8.9 DMA Transfer Control Registers (DTCRn)
TMP1942CY/CZ-148
TMP1942CY/CZ
3.8.3.8
31 DOT R/W -- 15 DOT R/W -- : Type : Initial value 0 : Type : Initial value
Data-holding register (DHR)
16
Bit
31 : 0
Mnemonic
DOT
Field Name
Data on Transfer
Description
Data on Transfer (initial value: --) This is the data read from the source during a transfer in dual-address mode.
Figure 3.8.10 Data-Holding Register (DHR)
TMP1942CY/CZ-149
TMP1942CY/CZ
3.8.4
Functions
This section describes the functions of the DMAC.
3.8.4.1
Outline The DMAC is a 32-bit DMA controller capable of performing high-speed data transfers in a system incorporating the TX19 processor core without the need for any intervention by the TX19 processor core itself. (1) Source and destination The DMAC performs data transfers between one memory device and another or between a memory device and an I/O device. The device from which data is transferred is referred to as the source device and the device to which data is transferred is referred to as the destination device. Both memory devices and I/O devices can be specified as the source and destination devices. However, the DMAC can only transfer data from a memory device to an I/O device, from an I/O device to memory, or from memory to memory; it cannot transfer data between two I/O devices. The difference between memory devices and I/O devices resides in the methods by which the devices are accessed. When the DMAC accesses an I/O device, it asserts the DACKn signal. Because only one DACKn signal line is available for each channel, the DMAC can only perform one data transfer involving an I/O device at a time; hence the DMAC cannot transfer data from one I/O device to another. An interrupt source can be specified for transfer requests to the DMAC. When an interrupt occurs, the interrupt controller generates a request to the DMAC. (In this case, no interrupt request to the TX19 processor core is generated. For details, refer to Section 3.4, "Interrupts".) This interrupt request from the interrupt controller is canceled by the DACKn signal. Therefore, when an I/O device has been set as a transfer device, a request to the DMAC is cancelled for each transfer performed (i.e., each time the amount of data specified by the TrSiz bits is transferred). On the other hand, in memory-to-memory transfers, DACKn is asserted only when the number of bytes to be transferred (as specified by the value of the BCRn register) falls to 0; hence several data transfers can be performed successively by a single transfer request. For example, when the DMAC is transferring data between the TMP1942's internal I/O and internal (or external) memory, although a transfer request from the internal I/O to the DMAC is cancelled for each transfer performed, the DMAC is kept waiting for the next transfer request unless the number of bytes to be transferred (as specified by the value of the BCRn register) falls to 0. Consequently, DMA transfer is performed successively until the BCRn register value is reduced to 0.
TMP1942CY/CZ-150
TMP1942CY/CZ
(2) Switching control of the bus (bus arbitration) When a transfer request is issued by the DMAC's internal circuitry, the DMAC requests control of the bus from the TX19 processor core. If an acknowledge signal is returned by the TX19 processor core, the DMAC gains control of the bus and can perform data transfer bus cycles. The DMAC can request two types of bus control: either bus control plus the use of the TX19 processor core's data bus (i.e., the snoop function), or bus control without the snoop function. This can be set independently for each channel in the corresponding register. The TX19 processor core may request release of bus control from the DMAC. Whether the DMAC should respond to this request is set using independent register settings for each channel. However, this response function is effective only when the DMAC does not request the snoop function (i.e., in GREQ mode). When the snoop function is requested (i.e., in SREQ mode), the response function will have no effect because the TX19 processor core cannot generate requests for release of bus control in this mode. When there are no more transfer requests, the DMAC will finish control of the bus. Note1: The NMI interrupt is left pending while the DMAC has control of the bus. Note2: Do not place the TMP1962 in Halt power-down mode while the DMAC is operating. (3) Transfer request modes The DMAC has two transfer request modes: internal transfer request mode and external transfer request mode. In internal transfer request mode, transfer requests are generated internally in the DMAC. A transfer request is generated by setting the start bit in one of the DMAC' internal registers (the s channel control register's Str bit) to 1, upon which the DMAC will start a transfer operation. In external transfer request mode, transfer requests are generated by assertion of the transfer request signal (INTDREQn), which is output by the interrupt controller after the start bit has been set to 1. The DMAC can select level mode, in which a transfer request is generated on detection of a High- or Low-level INTDREQn signal, or edge mode, in which a transfer request is generated on detection of the rising or falling edge of the INTDREQn signal. However, because the INTDREQn signal in the TMP1942 is low-active, always make sure that the transfer request signal is set to be detected at Low level. (4) Address modes Dual-address mode is the only address mode available for the DMAC in the TMP1942. There is no single-address mode for the DMAC. In dual-address mode, data transfers are performed between two memory devices or between memory and an I/O device. The addresses of the source and destination devices are output by the DMAC. When accessing an I/O device, the DMAC asserts the DACKn signal. In dual-address mode, the DMAC executes two bus operations, one for reading and one for writing. The transfer data read from the source device is temporarily stored in the DMAC's internal data-holding register (DHR) before being written to the destination device.
TMP1942CY/CZ-151
TMP1942CY/CZ
(5) Channel operation The DMAC has four channels (channels 0 to 3). Each channel is activated by setting the start bit (Str) in the channel control register (CCRn) to 1, so that the device enters ready state. When a transfer request occurs while a channel is in ready state, the DMAC gains control of the bus and performs a data transfer. When there are no more transfer requests, the DMAC finishes control of the bus, thereby entering ready state. When transfer for a channel is completed, the channel is placed in idle state. Transfers may be terminated either normally or abnormally (for example, when an error occurs during transfer). An interrupt signal can be generated on completion of transfer. Figure 3.8.11 is a state transition diagram for channel operations.
Bus control not owned by DMAC Ready Start
Bus control not owned by DMAC Stop
Bus control owned by DMAC
Transfer completed
Transfer Bus control owned by DMAC
Figure 3.8.11 State Transitions for Channel Operations
(6) Summary of transfer mode combinations The DMAC can perform data transfers as follows according to the combination of mode settings. Transfer Request
Internal External
Edge/Level
Low-level
Address Mode
Dual Dual
Transfer Devices
Memory-to-memory Memory-to-memory Memory-to-I/O I/O-to-memory
TMP1942CY/CZ-152
TMP1942CY/CZ
(7) Address change There are essentially three methods for changing the transfer address: increment, decrement or fixed. The method can be set independently for the source and destination addresses using the SAC and DAC bits in the CCRn register. If the transfer device is a memory device, increment, decrement or fixed may be specified. If the transfer device is an I/O device, only fixed may be specified. When an I/O device is selected as the source or destination device, be sure to set the SAC and DAC bits in the CCRn register to "fixed". If "increment" or "decrement" is selected as the address change method, the bit position at which counting begins can be set using the SACM and DACM bits in the DTCRn register. SACM corresponds to the source address and DACM the destination address. The bit position at which counting the address begins can be specified as bit 0, 4, 8, 12 or 16. Selecting bit 0 results in normal increment or decrement, increment or irregular decrement. Examples of how the address changes are shown below.
Example 1: When regular increment is selected for the source device and irregular increment is selected for the destination device
SAC: DAC: TrSiz: Source address: SACM = 000: DACM = 001: Increment the address Increment the address Transfer in units of 32 bits 0xA000_1000 Count the address beginning at bit 0 of the address counter Count the address beginning at bit 4 of the address counter Source First time Second time Third time Fourth time 0xA000_1000 0xA000_1004 0xA000_1008 0xA000_100C Destination 0xB000_0000 0xB000_0010 0xB000_0020 0xB000_0030
Destination address: 0xB000_0000
Example 2: When irregular decrement is selected for the source device and regular decrement is selected for the destination device
SAC: DAC: TrSiz: Source address: SACM = 010: DACM = 000: Decrement the address Decrement the address Transfer in units of 16 bits Initial value 0xA000_1000 Count the address beginning at bit 8 of the address counter Count the address beginning at bit 0 of the address counter Source First time Second time Third time Fourth time 0xA000_1000 0x9FFF_FF00 0x9FFF_FE00 0x9FFF_FD00 Destination 0xB000_0000 0xAFFF_FFFE 0xAFFF_FFFC 0xAFFF_FFFA
Destination address: 0xB000_0000
TMP1942CY/CZ-153
TMP1942CY/CZ
3.8.4.2 Transfer requests For data to be transferred by the DMAC, a transfer request must be generated and transmitted to the DMAC. There are two types of DMAC transfer requests: internal transfer requests and external transfer requests. The transfer request type can be set individually for each channel. For either type of transfer request, when a transfer request occurs after channel operation has been activated, the DMAC will gain control of the bus and perform data transfer. * Internal transfer requests A transfer request can be generated immediately by setting the Str bit in the CCRn register to 1 while the ExR bit in the same register = 0. This transfer request is referred to as an internal transfer request. In the case of an internal transfer request, because the transfer request remains active until channel operation has been completed, data transfers will be performed successively unless transition to a higher priority channel occurs or until bus control is transferred to a higher priority bus master. Internal transfer requests can only be used for transfers between memory and memory. * External transfer requests A transfer request is generated when the interrupt controller is notified of a transfer request by the assertion of the INTDREQn signal for a channel after the channel has been placed in ready state by setting the Str bit of the CCRn register to 1 while the ExR bit in the CCRn register = 0. This transfer request is referred to as an external transfer request. External transfer requests can be used for transfers between two memory devices and between memory and an I/O device. Assertion of the INTDREQn signal is recognized by detecting an edge or a level. The active edge or level is specified using the PosE bit in the CCRn register. However, because the INTDREQn signal in the TMP1942 is low-active, always make sure that the signal is set to be detected at Low level. The amount of data to be transferred for one transfer request is specified using the TrSiz field in the CCRn register. This can be specified as 32 bits, 16 bits or 8 bits. Transfer requests from the interrupt controller are cleared by assertion of the DACKn signal. The DACKn signal is asserted only when the number of bytes to be transferred during an I/O device bus cycle or a memory-to-memory transfer (as specified by the value of the BCRn register) falls to 0. Consequently, for data transfer between memory and an I/O device INTDREQn is cancelled every transfer request with the result that only one transfer is performed for the amount of data specified by TrSiz. On the other hand, in memory-to-memory transfers, INTDREQn is not cancelled until the number of bytes to be transferred (as specified by the value of the BCRn register) falls to 0; hence several data transfers can be performed successively by a single transfer request. Note that if an interrupt of the type specified for INTDREQn is acknowledged by the DMAC, but the interrupt is cleared by the interrupt controller or by another device before the DMAC starts the DMA transfer, one DMA transfer may be performed after the interrupt has been cleared.
TMP1942CY/CZ-154
TMP1942CY/CZ
3.8.4.3 Address modes The TMP1942 only supports dual-address mode in which both the source and destination devices are explicitly addressed.. In dual-address mode the DMAC first executes a read from the source device. The data read from the source device is temporarily stored in the DMAC's internal register DHR. Next, the DMAC executes a write to the destination device to write this data to the destination device, thus performing a data transfer from the source to the destination device. Although bit 15 of the CCRn register in the TMP1942 can be used to specify the address mode, this bit must always be set to 0 because the TMP1942 only supports dual-address mode.
DMAC
Source device
Address Address bus Data Data bus
(1)
(2) (1)
(2)
Destination device
Figure 3.8.12 Diagram of Data Transfer in Dual-Address Mode
TMP1942CY/CZ-155
TMP1942CY/CZ
DACK DMAC Source device (I/O)
Data Address
Address bus
Data bus
Destination device (memory)
Figure 3.8.13 Diagram of Data Transfer in Single-Address Mode
*
Dual-address mode In dual-address mode, a data transfer is executed using two bus operations: -Read operation, in which the DMAC outputs the address of the source device, reads data from the source device and stores the data in its internal register DHR -Write operation, in which the DMAC outputs the address of the destination device and writes the stored data from DHR to the destination device In dual-address mode, three types of transfers can be performed: -Memory-to-memory -Memory-to-I/O device -I/O device-to-memory The units of data transfer performed by the DMAC are equal to the amount of data (32 bits, 16 bits or 8 bits) specified in the TrSiz field of the CCRn register. This amount of data is transferred each time a transfer request is recognized. In dual-address mode, an amount of data equal to the transfer unit is read from the source device into the DHR register, then the data is written from the DHR register to the destination device. Memory accesses occur at intervals equal to the unit of data transfer which has been set. When external memory is accessed, if the transfer unit is 32 bits and the bus width set by the CS/wait controller is 16 bits, then two 16-bit accesses will occur. Similarly, if the transfer unit is 32 bits and the bus width set by the CS/wait controller is 8 bits, then four 8-bit accesses will occur.
TMP1942CY/CZ-156
TMP1942CY/CZ
For memory-to-I/O device or I/O device-to-memory data transfers, the bus width of the I/O device (the device port size) needs to be set (to 32 bits, 16 bits or 8 bits) using the DPS field in the CCRn register, in addition to the unit of data transfer. If the unit of data transfer and the device port size are equal, the DMAC will perform one read or write operation for the I/O device. If the device port size is smaller than the unit of data transfer, the DMAC will perform multiple read or write operations for the I/O device. For example, when performing a transfer to memory from an I/O device whose device port size is 8 bits when the unit of data transfer is 32 bits, the DMAC will read data from the I/O device and store it in the DHR register four times, 8 bits at a time, and then write 32 bits of data from the DHR register to memory in one operation (or in two operations if the external memory's data bus is 16 bits wide). The source and destination addresses change at intervals equal to the unit of data transfer. The value of the BCRn register also changes by an amount equal to the unit of data transfer. The device port size cannot be set to a value greater than the unit of data transfer. Table 3.8.2 summarizes the above information: Table 3.8.2 Unit of Data Transfer and Device Port Size (Dual-Address Mode) TrSiz
0x (32 bits) 0x (32 bits) 0x (32 bits) 10 (16 bits) 10 (16 bits) 10 (16 bits) 11 (8 bits) 11 (8 bits) 11 (8 bits)
DPS
0x (32 bits) 10 (16 bits) 11 (8 bits) 0x (32 bits) 10 (16 bits) 11 (8 bits) 0x (32 bits) 10 (16 bits) 11 (8 bits)
Number of Bus Operations Performed on I/O Device
Once Twice Four times Setting prohibited Once Twice Setting prohibited Setting prohibited Once
Note: The DMAC does not incremnt or decrement the address for I/O peripherals. Therefore, if, for example, TrSiz is programmed to 16 bits and DPS is programmed to 8 bits, both the first and second bus cycles access the lower eight bits of the I/O data bus.
TMP1942CY/CZ-157
TMP1942CY/CZ
3.8.4.4
Channel operations A channel is activated when the Str bit in the CCRn register for the channel is set to 1. When a channel is activated, it is checked for errors; if no error is found, it is placed in ready state. If a transfer request occurs while a channel is in ready state, the DMAC gains control of the bus and starts a transfer operation. Channel operation may terminate normally or abnormally, for example, when operation is forcibly terminated or terminated by an error. This status is indicated by the CSRn register. (1) Starting channel operation A channel is activated when the Str bit in the CCRn register for the channel is set to 1. When a channel is activated, it is checked for a configuration error; if no error is found, it is placed in ready state. If an error is detected, the channel operation terminates abnormally. When a channel is placed in ready state, the Act bit in the CSRn register for the channel is set to 1. If internal transfer requests have been set for the channel, a transfer request will be generated immediately, upon which the DMAC will gain control of the bus and start a data transfer. If external transfer requests have been set for the channel, a transfer request will be generated by assertion of INTDREQn, upon which the DMAC will gain control of the bus and start a data transfer. (2) Terminating channel operation Channel operation may terminate either normally or abnormally. This status is indicated in the CSRn register. If an attempt is made to set the Str bit in the CCRn register to 1 while the NC bit or AbC bit of the CSRn register = 1, channel operation will not start and will terminate abnormally. Normal termination Channel operation terminates normally in the following case. Note that, in this case, transfer will always terminate after the DMAC has finished transferring an amount of data equal to the unit of data transfer (the value set in the TrSiz field of the CCRn register). * When data transfer has been completed after the value of the BCRn register has fallen to 0 Abnormal termination Data transfers by the DMAC may terminate abnormally in the following cases: * Termination due to configuration errors A configuration error is an error in the DMA transfer settings. Since a configuration error occurs before the DMAC starts data transfer operation, the SARn, DARn and BCRn register values will remain as set. When operation for a channel terminates abnormally due to a configuration error, the Conf bit in the CSRn register is set to 1 at the same time that the AbC bit is set to 1. Causes of configuration errors are shown below. -Both SIO and DIO are set to 1. -The CCRn Str bit is set to 1 when the NC bit or AbC bit in the CSRn register = 1.
TMP1942CY/CZ-158
TMP1942CY/CZ
-A value which cannot be divided by the unit of data transfer is set in the BCRn register. -Values which cannot be divided by the unit of data transfer are set in the SARn and DARn registers. -An illegal combination of the device port size and data transfer unit has been set. -The Str bit in the CCRn register is set to 1 while the BCRn register = 0. * Termination due to bus errors When transfer terminates abnormally due to a bus error, the BES or BED bit in the CSRn register is set to 1 at the same time that the AbC bit in the CSRn register is set to 1. -The CPU is notified that a bus error has occurred during data transfer. 3.8.4.5 Channel priority The DMAC has four channels. A channel with a lower channel number always has higher priority. Therefore, if transfer requests occur for channels 0 and 1 simultaneously, the DMAC will perform the transfer operation for channel 0' transfer request first. When there are no more transfer requests s for channel 0, if the transfer request for channel 1 is still in effect, the DMAC will perform the transfer operation on channel 1. (For internal transfer requests, the transfer request is held unless it is cleared. For external transfer requests, this depends on the active state which has been set for the interrupt request assigned to DMA requests by the interrupt controller. If the active state is set to edge mode, the transfer request will be held by the interrupt controller. However, if the active state is set to level mode, the interrupt controller will not hold the transfer request. Therefore, if level mode is set, the interrupt request signal must be kept asserted until it is recognized by the DMAC.) If a transfer request for channel 0 occurs while data transfer on channel 1 is under way, a channel transition will occur. The data transfer on channel 1 will be suspended and the DMAC will start transfer on channel 0. When there are no more transfer request for channel 0, the DMAC will resumes the transfer operation on channel 1. Channel transition occurs when the DMAC has finished transferring an amount of data equal to the unit of data transfer. In dual-address mode, this is when the DMAC has finished writing all the stored data from the DHR register to the destination device. 3.8.4.6 Interrupts The DMAC can generate an interrupt request to the TX19 processor core on completion of channel operation. There are two types of interrupts which can be requested in this case: normal completion interrupt and abnormal completion interrupt. * Normal completion interrupt When channel operation terminates normally, the NC bit in the CSRn register is set to 1. At this time, if normal completion interrupts have been enabled using the NIEn bit in the CCRn register, an interrupt request to the TX19 processor core is generated. * Abnormal completion interrupt When channel operation terminates abnormally, the AbC bit in the CSRn register is set to 1. At this time, if abnormal completion interrupts have been enabled by the AbIEn bit in the CCRn register, an interrupt request to the TX19 processor core is generated.
TMP1942CY/CZ-159
TMP1942CY/CZ
3.8.4.7
Endian mode If the unit of data transfer and the device port size are not equal in dual-address mode, the DMAC will assemble or disassemble data in the DHR register. For example, if the source device is an I/O device whose port size is 8 bits while the destination device is a memory device, and the unit of data transfer is 32 bits, the DMAC reads data from the I/O device four times and assembles it into 32 bits of data in the DHR register before writing it to memory. For example, the diagram below shows the relationship between an 8-bit I/O device and a 32-bit DHR register. The TMP1942 supports only little-endian data alignment.
I/O device
8 4n + 3 4n + 2 4n + 1 4n + 0 D C B A
0
DHR 31 Big endian 31 Little endian D C B A A B C D 0 0
Figure 3.8.14 Data Packing and Unpacking
TMP1942CY/CZ-160
TMP1942CY/CZ
3.8.5
Operation
DMAC operations are synchronized to the rising edges of SYSCLK.
3.8.5.1
Dual-address mode * Memory-to-memory transfer Figure 3.8.15 shows a timing example for one transfer session when 16-bit data is being transferred from external memory (which is 16 bits wide) to external memory (which is also 16 bits wide). Although it is not shown here, data is transferred successively until the value of the BCRn register falls to 0.
tsys A [23 : 16]
CS0
CS1
RD WR / WHR
AD [15 : 0]
Addr
Data
Addr
Data
Read
Write
Figure 3.8.15 Dual-Address Mode (Memory to Memory)
*
Memory-to-I/O device transfer Figure 3.8.16 shows a timing example for memory-to-I/O device transfer for cases where the unit of data transfer and the device port size are set to 16 bits and 8 bits, respectively.
tsys A [23 : 16]
CS0
CS1
RD
WR
AD [15 : 0]
Addr
Data
Addr
Data
Addr
Data
Read
Write
Write
Figure 3.8.16 Dual-Address Mode (Memory to I/O Device)
TMP1942CY/CZ-161
TMP1942CY/CZ
* I/O device-to-memory transfer Figure 3.8.17 shows a timing example for I/O device-to-memory transfer for cases where the unit of data transfer and the device port size are set to 16 bits and 8 bits, respectively.
tsys A [23 : 16]
CS0
CS1
RD
WR / WHR
AD [15 : 0]
Addr
Data
Addr
Data
Addr
Data
Read
Read
Write
Figure 3.8.17 Dual-Address Mode (I/O Device to Memory)
TMP1942CY/CZ-162
TMP1942CY/CZ
Example: DMA transfer of serially received data (SCnBUF) to internal RAM Example DMA settings * Channel used: 0 * Source address: SC1BUF * Destination: 0xFFFF_9800 (physical address) * Number of bytes transferred: 256 Example serial channel settings * Data length: 8 bits, UART * Serial channel: Channel 1 * Transfer rate: 9600 bps DMA (channel 0) is used for transfer. DMA0 is activated by an interrupt received on SIO1. DMA0 settings
DCR IMCFL INTCLR DTCR0 SAR0 DAR0 BCR0 CCR0 0xFFFF_F208 0xFFFF_9800 0x0000_00FF 0x80C0_5B0F 27 0 0 0 0 11 1 0 1 1 x 1 1 0 0 0 23 1 7 x 0 0 0 1 0 0 19 0 3 1 1 1 1 0 0 0 0x8000_0000 15 7 0 /* Level = 4 (arbitrary value) */ /* Value of IVR [9:4] */ /* DACM = 000 */ /* SACM = 000 */ /* Physical address of SC1BUF */ /* Physical address of destination */ /* 256 (number of bytes to be transferred) */ xxxx, xxxx, xx10, x100 0x3c 0x0000_0000 /* Reset DMA */
(Contents) 31 1 15 0
SIO channel 1 settings
IMCCH INTCLR SC1CR BR1CR 31 15 /* Assign to DMC0 activation source */ /* IVR [9:4], INTRX1 interrupt source */ /* UART mode, 8-bit length, baud rate generator */ /* @fc = 32 MHz (approx. 9615 bps) */
xxxx, xxxx, xx11, 1000 0x32 0x29 0x00 0x1d SC1MOD0
TMP1942CY/CZ-163
TMP1942CY/CZ
3.9
8-Bit Timers (TMRA)
The TMP1942 contains twelve 8-bit timer channels (TMRA0-TMRAB). There are six TMRA modules, referred to as TMRA01, TMRA23, TMRA45, TMRA67, TMRA89 and TMRAAB, each of which is comprised of two channels. Each module can operate in the following four modes: * * * * 8-bit interval timer mode 16-bit interval timer mode 8-bit programmable square wave output mode (PPG: variable duty with variable cycle) 8-bit pulse width modulation output mode (PWM: variable duty with constant cycle)
Figure 3.9.1 shows a block diagram of TMRA01. Each channel consists primarily of an 8-bit up-counter, an 8-bit comparator and an 8-bit timer register. Each pair of channels also incorporates one prescaler and one timer flip-flop. Timer operation modes and flip-flops are controlled by five registers. The six modules (TMRA01, TMRA23, TMRA45, TMRA67, TMRA89 and TMRAAB) operate independently of each other. Because each module functions the same way except for a few differences as shown in Tables Table 3.9.1 and Table 3.9.2, operation of the TMRA01 only is described here. Table 3.9.1 Specification Differences Among the TMRA Modules Specification
External clock input pin Timer flip-flop output pin Timer run register SFR Name (address) Timer registers Timer mode register Timer flip-flop control register
Module TMRA01
TA0IN (Shared with PA7) TA1OUT (Shared with PA6) TA01RUN (0xFFFF_F100) TA0REG (0xFFFF_F102) TA1REG (0xFFFF_F103) TA01MOD (0xFFFF_F104) TA1FFCR (0xFFFF_F105)
TMRA23
TA2IN (Shared with PB7) TA3OUT (Shared with PB6) TA23RUN (0xFFFF_F108) TA2REG (0xFFFF_F10A) TA3REG (0xFFFF_F10B) TA23MOD (0xFFFF_F10C) TA3FFCR (0xFFFF_F10D)
TMRA45
TA4IN (Shared with PC0) TA5OUT (Shared with PC3) TA45RUN (0xFFFF_F110) TA4REG (0xFFFF_F112) TA5REG (0xFFFF_F113) TA45MOD (0xFFFF_F114) TA5FFCR (0xFFFF_F115)
External pins
Table 3.9.2 Specification Differences Among the TMRA Modules Specification
External clock input pin Timer flip-flop output pin Timer run register SFR Name (address) Timer registers Timer mode register Timer flip-flop control register
Module TMRA67
TA6IN (Shared with PC1) TA7OUT (Shared with PC5) TA67RUN (0xFFFF_F118) TA6REG (0xFFFF_F11A) TA7REG (0xFFFF_F11B) TA67MOD (0xFFFF_F11C) TA7FFCR (0xFFFF_F11D)
TMRA89
TA8IN (Shared with PC2) TA9OUT (Shared with PC7) TA89RUN (0xFFFF_F120) TA8REG (0xFFFF_F122) TA9REG (0xFFFF_F123) TA89MOD (0xFFFF_F124) TA9FFCR (0xFFFF_F125)
TMRAAB
TAAIN (Shared with PC4) TABOUT (Shared with PD5) TAABRUN (0xFFFF_F128) TAAREG (0xFFFF_F12A) TABREG (0xFFFF_F12B) TAABMOD (0xFFFF_F12C) TABFFCR (0xFFFF_F12D)
External pins
TMP1942CY/CZ-164
3.9.1
Prescaler run/clear 2 T1 Timer flip-flop TA1FF TA01RUN Selector 8-bit up-counter (UC0)
n
Prescaler clock: T0 4 T4 T16 T256 8 16 32 64 128 256 512 TA01RUN
Selector TA01RUN TA1FFCR T1 T16 T256 8-bit up-counter (UC1) TA01MOD
Timer flip-flop output: TA1OUT
Block diagram of each module
External clock input: TA0IN
T1 T4 T16 TA01MOD 2 -1 overflow TA01MOD Match detection TA0TRG TA01MOD 8-bit timer register TA0REG 8-bit timer register TA1REG
Only a block diagram of TMRA01 is described here. It applies to all other modules with the exception of differences in register, signal and other element names.
Figure 3.9.1 TMRA01 Block D iagram
8-bit comparator (CP0) Match 8-bit comparator detection (CP1)
TMP1942CY/CZ-165
Register buffer 0 Internal data bus TMRA0 interrupt output: INTTA0 TMRA0 match output: TA0TRG Internal data bus
TMP1942CY/CZ
TA01RUN
TMRA1 interrupt output: INTTA1
TMP1942CY/CZ 3.9.2 Functional description of each circuit
(1) Prescaler The TMP1942 has a 9-bit prescaler to supply a clock to TMRA01. The prescaler's input clock T0 has a frequency of fperiph, fperiph/2 or fperiph/4 as selected by SYSCR0 in the CG block. fperiph is either the clock fgear as selected by SYSCR1 in the CG block or the clock fc before division by the clock gear. The prescaler is set to either run or stop by TA01RUN. Writing a 1 to this bit causes the prescaler to start counting and writing 0 causes it to clear itself and stop counting. Table 3.9.3 shows the resolutions of the prescaler output clocks. Table 3.9.3 Prescaler Output Clock Resolutions
@fc = 32 MHz
Peripheral Clock Selection
Clock Gear Value
00 (fc)
Selected Prescaler Clock
00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
3 2
Prescaler Output Clock Resolution T1
fc/2 (0.25 s) fc/2 (0.125 s) fc/2 (0.5 s)
4
T4
fc/2 (1.0 s)
5 4
T16
fc/2 (4.0 s)
7 6 5 8 7 6
T256
fc/2 (64 s)
11 10 9
fc/2 (0.5 s) fc/2 (0.25 s)
3
fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (8.0 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (16 s)
9
fc/2 (32 s) fc/2 (16 s) fc/2 (128 s)
12
fc/2 (2.0 s)
6 5 4 7 6 5 8 7 6 5 4
01 (fc/2) 0 (fgear) 10 (fc/4)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
fc/2 (0.25 s)
3
fc/2 (1.0 s) fc/2 (0.5 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (8.0 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (0.5 s) fc/2 (0.25 s)
3
fc/2 (64 s)
11 10
fc/2 (1.0 s)
5 4
fc/2 (32 s) fc/2 (256 s)
13 12
fc/2 (0.5 s) fc/2 (2.0 s)
6 5
fc/2 (8.0 s)
8 7
fc/2 (128 s) fc/2 (64 s)
11
fc/2 (4.0 s) fc/2 (32 s)
10 9
fc/214 (512 s) fc/2 (256 s)
13 12
11 (fc/8)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
fc/2 (1.0 s) fc/2 (0.25 s)
3
fc/2 (16 s) fc/2 (8.0 s)
8 7 6 5 7 6
fc/2 (128 s) fc/2 (64 s)
11 10 9
fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/25 (1.0 s) fc/2 (4.0 s)
7 6 5 7 6 5
00 (fc)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
fc/2 (0.125 s)
2
fc/2 (32 s) fc/2 (16 s) fc/2 (64 s)
11 10 9
fc/2 (0.25 s)
3
fc/2 (1.0 s)
5 4
01 (fc/2) 1 (fc) 10 (fc/4)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)

fc/2 (0.5 s) fc/2 (0.25 s)
3
fc/2 (32 s) fc/2 (16 s) fc/2 (64 s)
11 10 9
fc/2 (1.0 s)
5 4
fc/2 (0.5 s) fc/2 (1.0 s)
5
fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (1.0 s)
fc/2 (32 s) fc/2 (16 s) fc/2 (64 s)
11 10 9
11 (fc/8)
01 (fperiph/2) 10 (fperiph)

fc/2 (32 s) fc/2 (16 s)
Note 1: The prescaler's output clock Tn must be selected such that the relationship Tn < fsys/2 is satisfied (i.e., Tn must be slower than fsys/2). Note 2: Do not change the clock gear value while the timer is operating. Note 3: The - character meams "Don't use".
TMP1942CY/CZ-166
TMP1942CY/CZ
(2) Up-counters (UC0 and UC1) UC0 and UC1 are 8-bit binary counters which count up synchronously with the input clock selected in timer mode register TA01MOD. The input clock for UC0 is either the external clock entered via the TA0IN pin or one of the three prescaler output clocks, T1, T4 or T16, according to the value set in TA01MOD . The input clock for UC1 varies with the operating mode. In 16-bit timer mode, up-counter UC0's overflow output is the input clock for UC1; in any other mode, the input clock for UC1 is either one of the three prescaler output clocks, T1, T16 or T256, or the comparator output (match detection) from TMRA0, as determined by the value set in TA01MOD. The TA01RUN and bits set the up-counters to run or stop. When reset, the up-counters are cleared with the timers stopped. (3) Timer registers (TA0REG and TA1REG) TA0REG and TA1REG are 8-bit registers used to set interval times. When the value set in one of these timer registers matches the corresponding up-counter value, the comparator's match detection signal becomes active. If the value set is 00H, this signal will become active when the up-counter overflows. TA0REG is paired with a register buffer to form a dual-buffer structure. The double-buffer is controlled by the setting of TA01RUN. The double-buffer is disabled when = 0 and enabled when = 1. When the double-buffer is enabled, data transfer from the register buffer to the timer register is initiated by a 2n-1 overflow in PWM mode or by cycle match detection in PPG mode. The double-buffer cannot be used in timer mode. When reset, is initialized to 0, disabling the double-buffer. To use the double-buffer, write data in the timer register and set to 1, then write the following data in the register buffer. Figure 3.9.2 shows the structure of TA0REG.
TMP1942CY/CZ-167
TMP1942CY/CZ
Up-counter
Comparator (CP0)
Timer register 0 (TA0REG) Y Shift trigger Register buffer 0 Write
Selector B PPG cycle match detection n PWM 2 -1 overflow Write to TA0REG
A S
TA01RUN Internal data bus
Figure 3.9.2 Structure of Timer Register 0 (TA0REG) Note: When data is written to TA0REG, the same address is allocated to the timer register and the register buffer. When = 0, the same value is written to the timer register and the register buffer. When = 1, data is written only to the register buffer. The addresses of the individual timer registers are as follows: TA0REG: 0xFFFF_F102H TA2REG: 0xFFFF_F10AH TA1REG: 0xFFFF_F103H TA3REG: 0xFFFF_F10BH
Each register is a write-only register and cannot be read. (4) Comparator (CP0) This circuit compares the up-counter value with the timer register value. When the values match, it clears the up-counter to 0 and at the same time generates an INTTA0 or INTTA1 interrupt. Also, if timer flip-flop inversion is enabled, it inverts the timer flip-flop value. (5) Timer flip-flop (TA1FF) The timer flip-flop TA1FF is designed to be inverted by a match detection signal from the comparator. Inversion can be disabled or enabled by setting TA1FFCR. TA1FF is cleared to 0 by a reset. The TA1FF value can be set to 1 or 0 by writing 01 or 10 to TA1FFCR. Also, the TA1FF value can be inverted by writing 00 to these bits (this is known as a soft inversion). The TA1FF value can be forwarded to the timer flip-flop output pin, TA1OUT (shared with PA6). When timer output is needed, this pin must be set for that purpose by using the port A registers PACR and PAFC.
TMP1942CY/CZ-168
TMP1942CY/CZ 3.9.3 Register description
TMRA01 run register
7 Bit symbol TA01RUN (0xFFFF_F100) Read/Write After reset TA0RDE R/W 0 Double Function Buffer 0: Disable 1: Enable This bit controls the TA0REG double-buffer. 0 1 Disable Enable I2TA01: TA1RUN: TA0RUN: Operation in IDLE mode Operation of timer 1 Operation of timer 0 6 -- -- -- 5 -- -- -- 4 -- -- -- 0 IDLE 0: Idle 0 3 I2TA01 2
TA01PRUN
1 TA1RUN 0 R/W
0 TA0RUN 0
Timer Run/Stop Control 0: Stop and cleared
1: Operate 1: Count
TA01PRUN: Operation of the prescaler
Note: TA01RUN bits 4, 5 and 6 are undefined when read.
TMRA23 run register
7 Bit symbol TA23RUN (0xFFFF_F108) Read/Write After reset TA2RDE R/W 0 Double Function Buffer 0: Disable 1: Enable This bit controls the TA2REG double-buffer. 0 1 Disable Enable I2TA23: TA3RUN: TA2RUN: Operation in IDLE mode Operation of timer 3 Operation of timer 2 6 -- -- -- 5 -- -- -- 4 -- -- -- 0 IDLE 0: Idle 0 3 I2TA23 2
TA23PRUN
1 TA3RUN 0 R/W
0 TA2RUN 0
Timer Run/Stop Control 0: Stop and cleared
1: Operate 1: Count
TA23PRUN: Operation of the prescaler
Note: TA23RUN bits 4, 5 and 6 are undefined when read.
Figure 3.9.3 TMRA Registers
TMP1942CY/CZ-169
TMP1942CY/CZ
TMRA45 run register
7 TA45RUN (0xFFFF_F110 ) Bit symbol Read/Write After reset TA4RDE R/W 0 Double Function Buffer 0: Disable 1: Enable This bit controls the TA4REG double-buffer. 0 1 Disable Enable I2TA45: TA5RUN: TA4RUN: Operation in IDLE mode Operation of timer 5 Operation of timer 4 6 -- -- -- 5 -- -- -- 4 -- -- -- IDLE 0: Idle 0 0 3 I2TA45 2 R/W 0 0 Timer Run/Stop Control 0: Stop and cleared 1 0 TA4RUN TA45PRUN TA5RUN
1: Operate 1: Count
TA45PRUN: Operation of the prescaler
Note: TA45RUN bits 4, 5 and 6 are undefined when read.
TMRA67 run register
7 TA67RUN (0xFFFF_F118) Bit symbol Read/Write After reset TA6RDE R/W 0 Double Function Buffer 0: Disable 1: Enable This bit controls the TA6REG double-buffer. 0 1 Disable Enable I2TA67: TA7RUN: TA6RUN: Operation in IDLE mode Operation of timer 7 Operation of timer 6 6 -- -- -- 5 -- -- -- 4 -- -- -- IDLE 0: Idle 0 0 3 I2TA67 2 R/W 0 0 Timer Run/Stop Control 0: Stop and cleared 1 0 TA6RUN TA67PRUN TA7RUN
1: Operate 1: Count
TA67PRUN: Operation of the prescaler
Note: TA67RUN bits 4, 5 and 6 are undefined when read.
Figure 3.9.4 TMRA Registers
TMP1942CY/CZ-170
TMP1942CY/CZ
TMRA89 run register
7 TA89RUN (0xFFFF_F120 ) Bit symbol Read/Write After reset TA8RDE R/W 0 Double Function Buffer 0: Disable 1: Enable This bit controls the TA8REG double-buffer. 0 1 Disable Enable I2TA89: TA9RUN: TA8RUN: Operation in IDLE mode Operation of timer 9 Operation of timer 8 6 -- -- -- 5 -- -- -- 4 -- -- -- 0 IDLE 0: Idle 0 3 I2TA89 2 R/W 0 0 Timer Run/Stop Control 0: Stop and cleared 1 0 TA8RUN TA89PRUN TA9RUN
1: Operate 1: Count
TA89PRUN: Operation of the prescaler
Note: TA89RUN bits 4, 5 and 6 are undefined when read.
TMRAAB run register
7 TAABRUN (0xFFFF_F128) Bit symbol Read/Write After reset TAARDE R/W 0 Double Function Buffer 0: Disable 1: Enable This bit controls the TAAREG double-buffer. 0 1 Disable Enable I2TAAB: TABRUN: TAARUN: Operation in IDLE mode Operation of timer B Operation of timer A 6 -- -- -- 5 -- -- -- 4 -- -- -- 0 IDLE 0: Idle 0 3 I2TAAB 2 R/W 0 0 Timer Run/Stop Control 0: Stop and cleared 1 0 TAARUN TAABPRUN TABRUN
1: Operate 1: Count
TAABPRUN: Operation of the prescaler
Note: TAABRUN bits 4, 5 and 6 are undefined when read.
Figure 3.9.5 TMRA Registers
TMP1942CY/CZ-171
TMP1942CY/CZ
TMRA01 mode register
7 Bit symbol TA01MOD (0xFFFF_F104) Read/Write After reset TA01M1 0 Operating mode 00: 8-bit timer Function 01: 16-bit timer 10: 8-bit PPG 11: 8-bit PWM 6 TA01M0 0 5 PWM01 0 PWM cycle 00: Reserved 01: 2 -1 10: 2 -1 11: 2 -1
8 7 6
4 PWM00 0 R/W
3 TA1CLK1 0 00: TA0TRG 01: T1 10: T16 11: T256
2 TA1CLK0 0
1 TA0CLK1 0
0 TA0CLK0 0
TMRA1 source clock
TMRA0 source clock 00: TA0IN pin input 01: T1 10: T4 11: T16
TMRA0 input clock 00 01 10 11 External input (TA0IN pin input) T1 T4 T16 (prescaler) (prescaler) (prescaler)
TMRA1 input clock
TA01MOD01 TA01MOD=01
00 01 10 11
TMRA0 match detection T1 T16 T256
TMRA0 overflow output 16-bit timer mode
Selects cycle in 8-bit PWM mode 00 01 10 11 Reserved (2 -1) x clock source
6 7 8
(2 -1) x clock source (2 -1) x clock source
Selects operating mode for TMRA01 00 01 10 11 8-bit timer x 2 16-bit timer 8-bit programmable square wave output 8-bit PWM (TMRA0), 8-bit timer (TMRA1)
Figure 3.9.6 TMRA Registers
TMP1942CY/CZ-172
TMP1942CY/CZ
TMRA23 mode register
7 TA23MOD (0xFFFF_F10C) Bit symbol Read/Write After reset 0 Operating mode 00: 8-bit timer Function 01: 16-bit timer 10: 8-bit PPG 11: 8-bit PWM 0 0 PWM cycle 00: Reserved 01: 2 -1 10: 2 -1 11: 2
8 7 6
6 TA01M0
5 PWM01
4 PWM00 0 R/W
3 TA1CLK1 0 00: TA2TRG 01: T1 10: T16 11: T256
2 TA1CLK0 0
1 TA0CLK1 0
0 TA0CLK0 0
TA01M1
TMRA3 source clock
TMRA2 source clock 00: TA2IN pin input 01: T1 10: T4 11: T16
TMRA2 input clock 00 01 10 11 External input (TA2IN pin input) T1 T4 T16 (prescaler) (prescaler) (prescaler)
TMRA3 input clock
TA23MOD01 TA23MOD=01
00 01 10 11
TMRA2 match detection T1 T16 T256
TMRA2 overflow output 16-bit timer mode
Selects cycle in 8-bit PWM mode 00 01 10 11 Reserved (2 -1) x clock source
6 7 8
(2 -1) x clock source (2 -1) x clock source
Selects operating mode for TMRA23 00 01 10 11 8-bit timer x 2 16-bit timer 8-bit programmable square wave output 8-bit PWM (TMRA2), 8-bit timer (TMRA3)
Figure 3.9.7 TMRA Registers
TMP1942CY/CZ-173
TMP1942CY/CZ
TMRA45 mode register
7 Bit symbol TA45MOD (0xFFFF_F114) Read/Write After reset TA45M1 0 Operating mode 00: 8-bit timer Function 01: 16-bit timer 10: 8-bit PPG 11: 8-bit PWM 6 TA45M0 0 5 PWM41 0 PWM cycle 00: Reserved 01: 2 -1 10: 2 -1 11: 2 -1
8 7 6
4 PWM40 0 R/W
3 TA5CLK1 0 00: TA4TRG 01: T1 10: T16 11: T256
2 TA5CLK0 0
1 TA4CLK1 0 00: TA4IN 01: T1 10: T4 11: T16
0 TA4CLK0 0
TMRA5 source clock
TMRA4 source clock
TMRA4 input clock 00 TA4IN 01 10 11 T1 T4 T16 (prescaler) (prescaler) (prescaler)
TMRA5 input clock
TA45MOD01 TA45MOD=01
00 01 10 11
TMRA4 match detection T1 T16 T256
TMRA4 overflow output 16-bit timer mode
Selects cycle in 8-bit PWM mode 00 01 10 11 Reserved (2 -1) x clock source
6 7 8
(2 -1) x clock source (2 -1) x clock source
Selects operating mode for TMRA45 00 01 10 11 8-bit timer x 2 16-bit timer 8-bit programmable square wave output 8-bit PWM (TMRA4), 8-bit timer (TMRA5)
Figure 3.9.8 TMRA Registers
TMP1942CY/CZ-174
TMP1942CY/CZ
TMRA67 mode register
7 Bit symbol TA67MOD (0xFFFF_F11C) Read/Write After reset TA67M1 0 Operating mode 00: 8-bit timer Function 01: 16-bit timer 10: 8-bit PPG 11: 8-bit PWM 6 TA67M0 0 5 PWM61 0 PWM cycle 00: Reserved 01: 2 -1 10: 2 -1 11: 2 -1
8 7 6
4 PWM60 0 R/W
3 TA7CLK1 0 00: TA6TRG 01: T1 10: T16 11: T256
2 TA7CLK0 0
1 TA6CLK1 0 00: TA6IN 01: T1 10: T4 11: T16
0 TA6CLK0 0
TMRA7 source clock
TMRA6 source clock
TMRA6 input clock 00 01 10 11 TA6IN T1 T4 T16 (prescaler) (prescaler) (prescaler)
TMRA7 input clock
TA67MOD01 TA67MOD=01
00 01 10 11
TMRA6 match detection T1 T16 T256
TMRA6 overflow output 16-bit timer mode
Selects cycle in 8-bit PWM mode 00 01 10 11 Reserved (2 -1) x clock source
6 7 8
(2 -1) x clock source (2 -1) x clock source
Selects operating mode for TMRA67 00 01 10 11 8-bit timer x 2 16-bit timer 8-bit programmable square wave output 8-bit PWM (TMRA6), 8-bit timer (TMRA7)
Figure 3.9.9 TMRA Registers
TMP1942CY/CZ-175
TMP1942CY/CZ
TMRA89 mode register
7 TA89MOD (0xFFFF_F124) Bit symbol Read/Write After reset 0 Operating mode 00: 8-bit timer Function 01: 16-bit timer 10: 8-bit PPG 11: 8-bit PWM 0 0 PWM cycle 00: Reserved 01: 2 -1 10: 2 -1 11: 2 -1
8 7 6
6 TA89M0
5 PWM81
4 PWM80 0 R/W
3 TA9CLK1 0 00: TA8TRG 01: T1 10: T16 11: T256
2 TA9CLK0 0
1 TA8CLK1 0 00: TA8IN 01: T1 10: T4 11: T16
0 TA8CLK0 0
TA89M1
TMRA9 source clock
TMRA8 source clock
TMRA8 input clock 00 01 10 11 TA8IN T1 T4 T16 (prescaler) (prescaler) (prescaler)
TMRA9 input clock
TA89MOD01 TA89MOD=01
00 01 10 11
TMRA8 match detection T1 T16 T256
TMRA8 overflow output 16-bit timer mode
Selects cycle in 8-bit PWM mode 00 01 10 11 Reserved (2 -1) x clock source
6 7 8
(2 -1) x clock source (2 -1) x clock source
Selects operating mode for TMRA89 00 01 10 11 8-bit timer x 2 16-bit timer 8-bit programmable square wave output 8-bit PWM (TMRA8), 8-bit timer (TMRA9)
Figure 3.9.10 TMRA Registers
TMP1942CY/CZ-176
TMP1942CY/CZ
TMRAAB mode register
7 Bit symbol TAABMOD (0xFFFF_F12C) Read/Write After reset TAABM1 0 Operating mode 00: 8-bit timer Function 01: 16-bit timer 10: 8-bit PPG 11: 8-bit PWM 6 TAABM0 0 5 PWMA1 0 PWM cycle 00: Reserved 01: 2 -1 10: 2 -1 11: 2 -1
8 7 6
4 PWMA0 0 R/W
3 TABCLK1 0 00: TAATRG 01: T1 10: T16 11: T256
2 TABCLK0 0
1 TAACLK1 0 00: TAAIN 01: T1 10: T4 11: T16
0 TAACLK0 0
TMRAB source clock
TMRAA source clock
TMRAA input clock 00 01 10 11 TAAIN T1 T4 T16 (prescaler) (prescaler) (prescaler)
TMRAB input clock
TAABMOD01 TAABMOD=01
00 01 10 11
TMRAA match detection T1 T16 T256
TMRAA overflow output 16-bit timer mode
Selects cycle in 8-bit PWM mode 00 01 10 11 Reserved (2 -1) x clock source
6 7 8
(2 -1) x clock source (2 -1) x clock source
Selects operating mode for TMRAAB 00 01 10 11 8-bit timer x 2 16-bit timer 8-bit programmable square wave output 8-bit PWM (TMRAA), 8-bit timer (TMRAB)
Figure 3.9.11 TMRA Registers
TMP1942CY/CZ-177
TMP1942CY/CZ
TMRA1 flip-flop control register
7 TA1FFCR (0xFFFF_F105) Bit symbol Read/Write After reset -- -- -- 6 -- -- -- 5 -- -- -- 4 -- -- -- 1 1 3 TAFF1C1 2 TAFF1C0 R/W 0 0 Selects TA1FF inversion signal. 0: TMRA0 1: TMRA1 00: Invert TA1FF value Controls TA1FF (soft inversion). inversion. 01: Set TA1FF to 1. 0: Disable 10: Clear TA1FF to 0. inversion. 11: Don't care 1: Enable (These bits are inversion. always 11 when read.) 1 TAFF1IE 0 TAFF1IS
Function
Selects the signal which inverts timer flip-flop 1 (TA1FF). (Don't care unless in 8-bit timer mode) 0 1 Inverted by TMRA0 Inverted by TMRA1
Note: TA1FFCR bits 4, 5, 6 and 7 are undefined when read.
TMRA3 flip-flop control register
7 TA3FFCR (0xFFFF_F10D) Bit symbol Read/Write After reset -- -- -- 6 -- -- -- 5 -- -- -- 4 -- -- -- 1 1 3 TAFF3C1 2 TAFF3C0 R/W 0 Controls TA3FF inversion. 0 Selects TA3FF inversion signal. 00: Invert TA3FF value (soft inversion). 01: Set TA3FF to 1. Function 10: Clear TA3FF to 0. 11: Don't care (These bits are always 11 when read.) 1 TAFF3IE 0 TAFF3IS
0: Disable inversion. 0: TMRA2 1: Enable 1: TMRA3 inversion.
Selects the signal which inverts timer flip-flop 3 (TA3FF). (Don't care unless in 8-bit timer mode) 0 1 Inverted by TMRA2 Inverted by TMRA3
Note: TA3FFCR bits 4, 5, 6 and 7 are undefined when read.
Figure 3.9.12 TMRA Registers
TMP1942CY/CZ-178
TMP1942CY/CZ
TMRA5 flip-flop control register
7 TA5FFCR (0xFFFF_F115) Bit symbol Read/Write After reset -- -- -- 6 -- -- -- 5 -- -- -- 4 -- -- -- 1 1 3 TAFF5C1 2 TAFF5C0 R/W 0 Controls TA5FF inversion. 0 Selects TA5FF inversion signal. 00: Invert TA5FF value (soft inversion). 01: Set TA5FF to 1. Function 10: Clear TA5FF to 0. 11: Don't care (These bits are always 11 when read.) 1 TAFF5IE 0 TAFF5IS
0: Disable inversion. 0: TMRA4 1: Enable 1: TMRA5 inversion.
Selects the signal which inverts timer flip-flop 5 (TA5FF). (Don't care unless in 8-bit timer mode) 0 1 Inverted by TMRA4 Inverted by TMRA5
Note: TA5FFCR bits 4, 5, 6 and 7 are undefined when read. TMRA7 flip-flop control register
7 TA7FFCR (0xFFFF_F11D) Bit symbol Read/Write After reset -- -- -- 6 -- -- -- 5 -- -- -- 4 -- -- -- 1 1 3 TAFF7C1 2 TAFF7C0 R/W 0 Controls TA7FF inversion. 0 Selects TA7FF inversion signal. 00: Invert TA7FF value (soft inversion). 01: Set TA7FF to 1. Function 10: Clear TA7FF to 0. 11: Don't care (These bits are always 11 when read.) 1 TAFF7IE 0 TAFF7IS
0: Disable inversion. 0: TMRA6 1: Enable 1: TMRA7 inversion.
Selects the signal which inverts timer flip-flop 7 (TA7FF). (Don't care unless in 8-bit timer mode) 0 1 Inverted by TMRA6 Inverted by TMRA7
Note: TA7FFCR bits 4, 5, 6 and 7 are undefined when read. Figure 3.9.13 TMRA Registers
TMP1942CY/CZ-179
TMP1942CY/CZ
TMRA9 flip-flop control register
7 TA9FFCR (0xFFFF_F125) Bit symbol Read/Write After reset -- -- -- 6 -- -- -- 5 -- -- -- 4 -- -- -- 1 1 3 TAFF9C1 2 TAFF9C0 R/W 0 Controls TA9FF inversion. 0 Selects TA9FF inversion signal. 00: Invert TA9FF value (soft inversion). 01: Set TA9FF to 1. Function 10: Clear TA9FF to 0. 11: Don't care (These bits are always 11 when read.) 1 TAFF9IE 0 TAFF9IS
0: Disable inversion. 0: TMRA8 1: Enable 1: TMRA9 inversion.
Selects the signal which inverts timer flip-flop 9 (TA9FF). (Don't care unless in 8-bit timer mode) 0 1 Inverted by TMRA8 Inverted by TMRA9
Note: TA9FFCR bits 4, 5, 6 and 7 are undefined when read. TMRAB flip-flop control register
7 TABFFCR (0xFFFF_F12D) Bit symbol Read/Write After reset -- -- -- 6 -- -- -- 5 -- -- -- 4 -- -- -- 1 1 3 TAFFBC1 2 TAFFBC0 R/W 0 Controls TABFF inversion. 0 Selects TABFF inversion signal. 00: Invert TABFF value (soft inversion). 01: Set TABFF to 1. Function 10: Clear TABFF to 0. 11: Don't care (These bits are always 11 when read.) 1 TAFFBIE 0 TAFFBIS
0: Disable inversion. 0: TMRAA 1: Enable 1: TMRAB inversion.
Selects the signal which inverts timer flip-flop B (TABFF). (Don't care unless in 8-bit timer mode) 0 1 Inverted by TMRAA Inverted by TMRAB
Note: TABFFCR bits 4, 5, 6 and 7 are undefined when read. Figure 3.9.14 TMRA Registers
TMP1942CY/CZ-180
TMP1942CY/CZ 3.9.4 Functional description for each mode
(1) 8-bit timer mode TMRA0 and TMRA1 can be used as 8-bit interval timers independently of each other. You must stop TMRA0 and TMRA1 before attempting to set their functions or count data.
a. Generating interrupts periodically The following description uses TMRA1 as an example. To generate a TRAM1 interrupt, INTTA1, at certain intervals, first stop timer 1 and set the operating mode, input clock and cycle in the TA01MOD and TA1REG registers. Next, enable the INTTA1 interrupt and start timer 1. Example: To generate INTTA1 interrupts every 20 s with fc = 32 MHz, set the registers in the following sequence:
*Clock conditions System clock: Prescaler clock: MSB 7 TA01RUN TA01MOD TA1REG IMC5LH TA01RUN - 0 0 X - 6 - 0 1 X X 5 X X 0 1 X 4 X X 1 1 X 3 - 1 0 0 - LSB 2 - 0 0 1 1 1 0 X 0 0 1 0 - X 0 1 - Stop TMRA1 and clear it to 0. Select 8-bit timer mode and set input clock to T1 (0.25 s resolution, fc = 32 MHz). Write 20 s/T1 = 80 (50H) to TA1REG. Enable INTTA1 and set interrupt level = 5 and rising edge detection. Start TMRA1. High-speed (fc) fperiph/4 (fperiph = fsys)
Note:
X = Don't care; "--" = No change For a description of input clock selection, refer to Table 3.9.3.
Note:
The input clocks for TMRA0 and TMRA1 differ as shown below. TMRA0: TA0IN pin input, T1, T4 or T16 TMRA1: TMRA0 match detection signal, T1, T16 or T256
TMP1942CY/CZ-181
TMP1942CY/CZ
b. Outputting a 50% duty cycle square wave Invert the value of timer flip-flop TA1FF at certain intervals and forward the inverted value to the timer flip-flop output pin, TA1OUT. Example: To output a 1.5-s cycle square wave with fc = 32 MHz on the TA1OUT pin, set each register in the following sequence. In this example TMRA1 is used to show how to set the registers, although either TMRA0 or TMRA1 may be used.
*Clock conditions System clock: High-speed clock gear: Prescaler clock: 7 TA01RUN TA01MOD TA1REG TA1FFCR P7CR P7FC TA01RUN - 0 0 X - - - 6 X 0 0 X - - X 5 X X 0 X - - X 4 X X 0 X - - X 3 - 0 0 1 - - - 2 - 1 0 0 - - 1 1 0 - 1 1 1 1 1 0 - - 1 1 - - - Stop TMRA1 and clear it to 0. Select 8-bit timer mode and set input clock to T1 (0.25 s resolution, fc = 32 MHz). Write (1.5 s/T1)/2 = 3 to TA1REG. Clear TA1FF to 0 and set it to be cleared by match detection signal from TMRA1. Set PA6 to TA1OUT output pin. Start TMRA1. High-speed (fc) x 1 (fc) fperiph/4 (fperiph = fsys)
Note:
X = Don't care; "--" = No change
T1 TA01RUN BIT7 2 Up-count er BIT1 BIT0 Comparator timing Comparator output (match detection) INTTA1 Up-counter clear TA1FF TA1OUT 0.75 s @fc = 32 MHz 0 1 2 3 0 1 2 3 0 1 2 3 0
Figure 3.9.15 Square Wave Output Timing (50% Duty Cycle) c. Using a match signal from TMRA0 to make TMRA1 count Select 8-bit timer mode and set the TMRA1 input clock to the TMRA0 comparator output.
Comparator TMRA0 match output TMRA0 up-counter (when TA0REG =5) TMRA1 up-counter (when TA1REG =2) TMRA1 match output
1
2
3 1
4
5
1
2
3 2
4
5
1
2 1
3
Figure 3.9.16 TMRA1 Counting Based on TMRA0
TMP1942CY/CZ-182
TMP1942CY/CZ
(2) 16-bit timer mode TMRA0 and TMRA1 can be used together as a 16-bit interval timer. To select 16-bit timer mode, set TA01MOD to 01. In 16-bit timer mode, the TMRA1 input clock is derived from the TMRA0 overflow output regardless of the TA01MOD settings. For a description of TMRA1 input clock selection, refer to Table 3.9.3. Set the timer interrupt cycle in the timer registers TA0REG and TA1REG by writing the eight low-order bits to TA0REG and the eight high-order bits to TA1REG. Always set TA0REG first. This is because compare operation is temporarily disabled when data is written to TA0REG; it is re-enabled when data is subsequently written to TA1REG. Example: To generate INTTA1 interrupts every 0.2 second with fc = 32 MHz, set the values shown below in the timer registers TA0REG and TA1REG.
*Clock conditions System clock: High-speed clock gear: Prescaler clock: High-speed (fc) x 1 (fc) fperiph/4 (fperiph = fsys)
With T16 (= 4.0 s at 32 MHz) used as the input clock, 0.2 s/4.0 s = 50000 = C350H Therefore, TA1REG must be set to 03H and TA0REG to 50H. A TMRA0 comparator output is generated each time the up-counter UC0 and timer register TA0REG match (the up-counter UC0 is not cleared). In this case INTTA0 is not generated. The TMRA1 comparator outputs a match detection signal at each comparator timing when the up-counter UC1 and timer register TA1REG match. If the comparators in both TMRA0 and TMRA1 output a match detection signal at the same time, the up-counters UC0 and UC1 will be cleared to 0 and an INTTA1 interrupt is generated. Also, if inversion is enabled, the value of timer flip-flop TA1FF will be inverted. Example: TA1REG = 04H and TA0REG = 80H
Up-counter values 0000H (UC1 and UC0) Match detection signal from TMRA0 comparator Interrupt INTTA1 Timer output TA1OUT Invert 0080H 0180H 0280H 0380H 0480H
Figure 3.9.17 Timer Output in 16-Bit Timer Mode
TMP1942CY/CZ-183
TMP1942CY/CZ
(3) 8-bit PPG (programmable square wave) output mode A square wave of any frequency with any duty cycle can be output using TMRA0. Either Low-active or High-active output pulses can be selected. TMRA1 cannot be used in this mode. The square wave is forwarded to TA1OUT (shared with PA6).
tH tL
t TA0REG and up-counter 0 match (generating INTTA0) TA1REG and up-counter 0 match (generating INTTA1) TA1OUT TA0REG TA1REG
Figure 3.9.18 8-Bit PPG Output Waveform This mode is used to output a programmable square wave by inverting the timer output every time the 8-bit up-counter UC0 matches the timer registers TA0REG and TA1REG. However, the condition (TA0REG set value) < (TA1REG set value) must be satisfied. Although the up-counter UC1 of TMRA1 cannot be used in this mode, TA01RUN must be set to 1 to enable TMRA1 counting. Figure 3.9.19 shows a block diagram of 8-bit PPG output mode.
TA1OUT Selector
T1 T4 T16
TA01RUN 8-bit up-counter (UC 0)
TA1FF TA1FFCR Invert
TA01MOD Comparator Comparator
INTTA0 INTTA1
Selector TA0REG-WR
TA0REG Shift trigger Register buffer TA1REG
TA01RUN
Internal data bus
Figure 3.9.19 8-Bit PPG Output Mode Block Diagram
TMP1942CY/CZ-184
TMP1942CY/CZ
If TA0REG has its double-buffer enabled in this mode, the value in the register buffer is shifted into TA0REG when TA1REG and UC0 match. If it is necessary to change the duty cycle, using the double-buffer facilitates satisfying the requirements for small duty cycle waveforms.
TA0REG and upcounter 0 match TA1REG and upcounter 0 match TA0REG (compare value) Register buffer
(Up-counter = Q1)
(Up-counter = Q2) Shift to register buffer Q2
Q1 Q2
Q3 Write to TA0REG (register buffer)
Figure 3.9.20 Register Buffer Operation
Example: To output a 1/4 duty cycle 50-kHz pulse (fc = 32 MHz)
20 s *Clock conditions System clock: High-speed clock gear: Prescaler clock: High-speed (fc) x 1 (fc) fperiph/4 (fperiph = fsys)
Calculate the values to be set in the timer registers as follows: To obtain a frequency of 50 kHz, generate a waveform with a period t = 1/50 kHz = 20 s. When T1 = 0.25 s (at fc = 32 MHz), 20 s/0.25 s = 80 Therefore, TA1REG must be set to 80 (= 50H). Next, to obtain a 1/4 duty cycle, using the formula t x 1/4 = 20 s x 1/4 = 5 s, 5 s/0.25 s = 20 Therefore, TA0REG must be set to 20 (= 14H).
7 TA01RUN TA01MOD TA0REG TA1REG TA1FFCR 0 1 0 0 X 6 X 0 0 1 X 5 X X 0 0 X 4 X X 1 1 X 3 - X 0 0 0 2 0 X 1 0 1 1 0 0 0 0 1 0 0 1 0 0 X Stop TMRA0 and TMRA1 and clear them to 0. Select 8-bit PPG mode and set input clock to T1. Write 14H. Write 50H. Set TA1FF and enable inversion. If these bits are set to 10, Low-active output waveform will be obtained. P7CR P7FC TA01RUN - - 1 - - X - - X - - X - - - - - 1 1 1 1 - - 1 Set PA6 to TA1OUT output pin. Start TMRA0 and TMRA1.
Note:
X = Don't care; "--" = No change
TMP1942CY/CZ-185
TMP1942CY/CZ
(4) 8-bit PWM output mode This mode, only available for TMRA0, can output PWM pulses with up to 8-bit resolution. PWM output is forwarded to the TA1OUT pin (shared with PA6). In this mode TMRA1 can be used as an 8-bit timer. Timer output is inverted when the up-counter UC0 and the value set in the timer register TA0REG match. It is also inverted when a 2n-1 counter overflow occurs (n = 6, 7 or 8 as specified in TA01MOD). The up-counter UC0 is cleared to 0 upon the occurrence of a 2n-1 counter overflow. Before PWM mode can be used, the following conditions must be satisfied: (TA0REG set value) < (2n-1 counter overflow set value) (TA0REG set value) 0
TA0REG and up-counter 0 match 2 -1 overflow (INTTA0 interrupt) TA1OUT
n
tPWM (PWM cycle)
Figure 3.9.21 8-Bit PWM Output Waveform Figure 3.9.22 shows a block diagram of 8-bit PWM output mode.
TA01RUN T1 T4 T16 8-bit up-counter Selector
(UC 0)
TA1OUT TA1FFCR
Clear
TA1FF Invert
TA01MOD
2 -1 overflow control
n
TA01MOD
Overflow Comparator INTTA0 TA0REG Selector Shift trigger Register buffer
TA0REG-WR
TA01RUN Internal data bus
Figure 3.9.22 8-Bit PWM Output Mode Block Diagram
TMP1942CY/CZ-186
TMP1942CY/CZ
If TA0REG has its double-buffer enabled in this mode, the value in the register buffer is shifted into TA0REG upon the detection of a 2n-1 overflow. Using the double-buffer facilitates satisfying the requirements for small duty cycle waveforms.
TA0REG and up-counter 0 match 2 -1 overflow TA0REG (compare value) Register buffer Q1 Q2 Shift to TA0REG Q2 Q3 Write to TA0REG (register buffer)
n
Up-counter = Q1
Up-counter = Q2
Figure 3.9.23 Register Buffer Operation Example: To output the following PWM waveform on the TA1OUT pin using TMRA0 when fc = 32 MHz
18 s 31.75 s *Clock conditions System clock: High-speed clock gear: Prescaler clock: High-speed (fc) x 1 (fc) fperiph/4 (fperiph = fsys)
To achieve a PWM cycle of 31.75 s with T1 = 0.25 s (at fc = 32 MHz), the following equation must be satisfied: 31.75 s/0.25 s = 127 = 2n-1 Therefore, n must be set to 7. Since the Low-level period is 18 s and T1 = 0.25 s, 18 s/0.25 s = 72 = 48H Therefore, TA0REG must be set to 48H.
MSB 7 TA01RUN TA01MOD TA0REG TA1FFCR P7CR P7FC TA01RUN - 1 0 X - - 1 6 X 1 1 X - - X 5 X 1 0 X - - X 4 X 0 0 X - - X LSB 3 - - 1 1 - - - 2 - - 0 0 - - 1 1 - 0 0 1 1 1 - 0 0 1 0 X - - 1 Stops TMRA0 and clear it to 0. Select 8-bit PWM mode (cycle = 2 -1) and set input clock to T1. Write 48H. Clear TA1FF and enable inversion.
7
Set PA6 to TA1OUT output pin. Start TMRA0.
Note:
X = Don't care; "--" = No change
TMP1942CY/CZ-187
TMP1942CY/CZ
Table 3.9.4 PWM Periods
@fc = 32 MHz
Peripheral Clock Selection
Clock Gear Value
Selected Prescaler Clock
00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
PWM Period 2 -1
6
27 - 1 T16
252 s 126 s 63 s 504 s 252 s 126 s 504 s 252 s
28 - 1 T16
508 s 254 s 127 s 508 s 254 s
T1
15.8 s 7.9 s 31.5 s 15.8 s 63 s 31.5 s 126 s 63 s 15.8 s 7.9 s 15.8 s
T4
63 s 31.5 s 15.8 s 126 s 63 s 31.5 s 126 s 63 s
T1
31.8 s 63.5 s 31.8 s 63.5 s
T4
127 s 31.8 s 127 s 63.5 s
T1
63.8 s 63.8 s
T4
T16
255 s 1020 s 63.8 s 255 s
00 (fc)
15.9 s 63.5 s
31.9 s 127.5 s 510 s
254 s 1016 s 127.5 s 510 s 2040 s 255 s 1020 s 127.5 s 510 s
01 (fc/2) 0 (fgear) 10 (fc/4)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
252 s 1008 s 127 s
508 s 2032 s 255 s 1020 s 4080 s 254 s 1016 s 127.5 s 510 s 2040 s 127 s 508 s 255 s 1020 s
504 s 2016 s 254 s 1016 s 4064 s 510 s 2040 s 8160 s 252 s 1008 s 127 s 126 s 63 s 31.5 s 15.8 s 63 s 31.5 s 15.8 s 63 s 31.5 s 63 s 504 s 252 s 126 s 63 s 252 s 126 s 63 s 252 s 126 s 63 s 252 s 126 s 63 s 31.8 s 31.8 s 508 s 2032 s 255 s 1020 s 4080 s 254 s 1016 s 127 s 31.8 s 127 s 63.5 s 31.8 s 127 s 63.5 s 127 s 508 s 254 s 127 s 508 s 254 s 127 s 508 s 254 s 127 s 508 s 254 s 127 s 63.8 s 63.8 s 510 s 2040 s 255 s 1020 s 63.8 s 255 s
11 (fc/8)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
00 (fc)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
15.9 s 63.5 s
31.9 s 127.5 s 510 s 255 s 1020 s 127.5 s 510 s 63.8 s 255 s 255 s 1020 s 127.5 s 510 s 255 s 510 s 255 s 255 s 1020 s
01 (fc/2) 1 (fc) 10 (fc/4)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
11 (fc/8)
01 (fperiph/2) 10 (fperiph)
Note 1: The prescaler's output clock Tn must be selected such that the relationship Tn < fsys/2 is satisfied (i.e., Tn must be slower than fsys/2). Note 2: Do not change the clock gear value while the timer is running. Note 3: The -- character means "Don't use".
TMP1942CY/CZ-188
TMP1942CY/CZ
(5) Summary of operating mode settings Table 3.9.5 summarizes the settings for TMRA01 for each mode. Table 3.9.5 Register Settings for Each Timer Mode Register Name Register Field Name Function TA01MOD Timer mode PWM period High-order timer input clock
Low-order timer match, T1, T16, T256 (00, 01, 10, 11)
TA1FFCR TAFF1IS Timer F/F Low-order timer inverting signal input clock selection
External, T1, T4, T16 (00, 01, 10, 11) External, 0: Low-order timer output 1: High-order timer output
8-bit timer x 2 channels
00
16-bit timer mode
01
T1, T4, T16 (00, 01, 10, 11) External, T1, T4, T16 (00, 01, 10, 11) External, T1, T4, T16 (00, 01, 10, 11)
8-bit PPG x 1 channel 8-bit PWM x 1 channel 8-bit timer x 1 channel (Note) "--" = Don't care
10
6
2 - 1, 2 - 1, 8 2 -1 (01, 10, 11)
7
T1, 16, T256 (01, 10, 11)
11
PWM output
Note: In 8-bit PWM generation mode, the UC1 can be used as an 8-bit timer. However, the match-detect output from the UC0 can not be used as a clock source for the UC1, and the timer output is not available for the UC1.
TMP1942CY/CZ-189
TX1942CY/CZ
3.
3.10 16-Bit Timers/Event Counters (TMRBn)
The TMP1942 contains fourteen multi-function 16-bit timer/event counter channels (TMRB0-TMRBD). TMRBn can operate in the following four modes: * * * * 16-bit interval timer mode 16-bit event counter mode 16-bit programmable square wave output (PPG) mode 2-phase pulse input counter mode (only for TMRB2 and TMRB3)
In addition, when used in combination with the capture function, TMRBn can be run in the following modes: * * * Frequency measurement mode Pulse width measurement mode Time difference measurement mode
Each channel consists primarily of a 16-bit up-counter, two 16-bit timer registers (one with a double-buffer structure), two 16-bit capture registers, two comparators, capture input controller, and a timer flip-flop with accompanying control circuit. Timer operating modes and flip-flops are controlled by eleven registers. All channels TMRB0 to TMRBD operate independently of each other. Because each channel functions the same way except for the 2-phase pulse counter function and a few other differences as shown in Tables 3.10.1 to 3.10.2, operation of the TMRB0 only is described here, with an explanation of the 2-phase pulse counter function for TMRB2 and TMRB3. Table 3.10.1 Specification Differences Among the TMRB Channels Specification
External clock/ capture trigger input pins Capture trigger timer Timer flip-flop output pin Timer run register Timer mode register Timer flip-flop control register
Channel TMRB0
TB0IN0 (Shared with PA0) TB0IN1 (Shared with PA1) TA3OUT
TMRB1
TB1IN0 (Shared with PA3) TB1IN1 (Shared with PA4) TA3OUT
TMRB2
TB2IN0 (Shared with PB0) TB2IN1 (Shared with PB1) TA3OUT
TMRB3
TB3IN0 (Shared with PB3) TB3IN1 (Shared with PB4) TA3OUT
External pins
TB0OUT (Shared with PA2) TB1OUT (Shared with PA5) TB2OUT (Shared with PB2) TB3OUT (Shared with PB5) TB0RUN (0xFFFF_F140) TB0MOD (0xFFFF_F142) TB0FFCR (0xFFFF_F143) TB0RG0L (0xFFFF_F148) TB1RUN (0xFFFF_F150) TB1MOD (0xFFFF_F152) TB1FFCR (0xFFFF_F153) TB1RG0L (0xFFFF_F158) TB1RG0H (0xFFFF_F159) TB1RG1L (0xFFFF_F15A) TB2RUN (0xFFFF_F160) TB2MOD (0xFFFF_F162) TB2FFCR(0xFFFF_F163) TB2RG0L (0xFFFF_F168) TB2RG1L (0xFFFF_F16A) TB3RUN (0xFFFF_F170) TB3MOD (0xFFFF_F172) TB3FFCR (0xFFFF_F173) TB3RG0L (0xFFFF_F178) TB3RG1L (0xFFFF_F17A)
Register name Timer registers (address)
TB0RG0H (0xFFFF_F149) TB0RG1L (0xFFFF_F14A) TB0RG1H (0xFFFF_F14B) TB0CP0L (0xFFFF_F14C)
TB2RG0H (0xFFFF_F169) TB3RG0H (0xFFFF_F179)
TB1RG1H (0xFFFF_F15B) TB2RG1H (0xFFFF_F16B) TB3RG1H (0xFFFF_F17B) TB1CP0L (0xFFFF_F15C) TB1CP1L (0xFFFF_F15E) TB1CP1H (0xFFFF_F15F) TB2CP0L (0xFFFF_F16C) TB2CP1L (0xFFFF_F16E) TB2CP1H (0xFFFF_F16F) TB3CP0L (0xFFFF_F17C) TB3CPIL (0xFFFF_F17E) TB3CPIH (0xFFFF_F17F)
Capture registers
TB0CP0H (0xFFFF_F14D) TB0CP1L (0xFFFF_F14E) TB0CP1H (0xFFFF_F14F)
TB1CP0H (0xFFFF_F15D) TB2CP0H (0xFFFF_F16D) TB3CP0H (0xFFFF_F17D)
TMP1942CY/CZ-190
TX1942CY/CZ
Table 3.10.2 Specification Differences Among the TMRB Channels Specification
External clock/ capture trigger input pins Capture trigger timer Timer flip-flop output pin Timer run register Timer mode register Timer flip-flop control register
Channel TMRB4
TB4IN0 (Shared with PB2) TB4IN1 (Shared with PB5) TA3OUT TA3OUT -- TA3OUT --
TMRB5
TMRB6
TMRB7
TB4IN0 (Shared with P95) TB4IN1 (Shared with P96) TA3OUT
External pins
TB4OUT (Shared with P92) TB5OUT (Shared with P93) TB6OUT (Shared with P94) TB7OUT (Shared with P97) TB4RUN (0xFFFF_F180) TB4MOD (0xFFFF_F182) TB4FFCR (0xFFFF_F183) TB4RG0L (0xFFFF_F188) TB5RUN (0xFFFF_F190) TB5MOD (0xFFFF_F192) TB5FFCR (0xFFFF_F193) TB5RG0L (0xFFFF_F198) TB5RG0H (0xFFFF_F199) TB5RG1L (0xFFFF_F19A) TB6RUN (0xFFFF_F1A0) TB6MOD (0xFFFF_F1A2) TB6FFCR(0xFFFF_F1A3) TB6RG0L (0xFFFF_F1A8) TB7RUN (0xFFFF_F1B0) TB7MOD (0xFFFF_F1B2) TB7FFCR (0xFFFF_F1B3) TB7RG0L (0xFFFF_F1B8)
Register name Timer registers (address)
TB4RG0H (0xFFFF_F189) TB4RG1L (0xFFFF_F18A) TB4RG1H (0xFFFF_F18B) TB4CP0L (0xFFFF_F18C)
TB6RG0H (0xFFFF_F1A9) TB7RG0H (0xFFFF_F1B9) TB6RG1L (0xFFFF_F1AA) TB7RG1L (0xFFFF_F1BA)
TB5RG1H (0xFFFF_F19B) TB6RG1H (0xFFFF_F1AB) TB7RG1H (0xFFFF_F1BB) TB5CP0L (0xFFFF_F19C) TB5CP1L (0xFFFF_F19E) TB5CP1H (0xFFFF_F19F) TB6CP0L(0xFFFF_F1AC) TB6CP1L (0xFFFF_F1AE) TB7CP0L (0xFFFF_F1BC) TB7CP0H(0xFFFF_F1BD) TB7CPIL (0xFFFF_F1BE)
Capture registers
TB4CP0H (0xFFFF_F18D) TB4CP1L (0xFFFF_F18E) TB4CP1H (0xFFFF_F18F)
TB5CP0H (0xFFFF_F19D) TB6CP0H(0xFFFF_F1AD)
TB6CP1H (0xFFFF_F1AF) TB7CPIH (0xFFFF_F1BF)
Table 3.10.3 Specification Differences Among the TMRB Channels Specification
External clock/
Channel TMRB8
TB8IN0 (Shared with PC6) TB8IN1 (Shared with PC7) TA5OUT -- TB8RUN (0xFFFF_F1C0) TB8MOD (0xFFFF_F1C2) -- TB8RG0L (0xFFFF_F1C8)
TMRB9
TB9IN0 (Shared with PD0) TB8IN1 (Shared with PD1) TA5OUT -- TB9RUN (0xFFFF_F1D0) TB9MOD (0xFFFF_F1D2) -- TB9RG0L (0xFFFF_F1D8)
TMRBA
TBAIN0 (Shared with PD5) TBAIN1 (Shared with PD6) TA5OUT -- TBARUN (0xFFFF_F1E0) TBAMOD (0xFFFF_F1E2) --
TMRBB
-- TA5OUT -- TBBRUN (0xFFFF_F1F0) TBBMOD (0xFFFF_F1F2) --
External pins
capture trigger input pins Capture trigger timer Timer flip-flop output pin Timer run register Timer mode register Timer flip-flop control register
TBARG0L (0xFFFF_F1E8) TBBRG0L (0xFFFF_F1F8)
Register name Timer registers (address)
TB8RG0H (0xFFFF_F1C9) TB9RG0H (0xFFFF_F1D9) TBARG0H (0xFFFF_F1E9) TBBRG0H (0xFFFF_F1F9) TB8RG1L (0xFFFF_F1CA) TB9RG1L (0xFFFF_F1DA) TBARG1L (0xFFFF_F1EA) TBBRG1L (0xFFFF_F1FA) TB8RG1H (0xFFFF_F1CB) TB9RG1H (0xFFFF_F1DB) TBARG1H (0xFFFF_F1EB) TBBRG1H (0xFFFF_F1FB) TB8CP0L (0xFFFF_F1CC) TB9CP0L (0xFFFF_F1DC) TB9CP1L (0xFFFF_F1DE) TBACP0L (0xFFFF_F1EC) TBBCP0L (0xFFFF_F1FC) TBACP1L (0xFFFF_F1EE) TBBCPIL (0xFFFF_F1FE)
Capture registers
TB8CP0H (0xFFFF_F1CD) TB9CP0H (0xFFFF_F1DD) TBACP0H (0xFFFF_F1ED) TBBCP0H (0xFFFF_F1FD) TB8CP1L (0xFFFF_F1CE) TB8CP1H (0xFFFF_F1CF) TB9CP1H (0xFFFF_F1DF) TBACP1H (0xFFFF_F1EF) TBBCPIH (0xFFFF_F1FF)
TMP1942CY/CZ-191
TX1942CY/CZ
Table 3.10.4 Specification Differences Among the TMRB Channels Specification
External clock/ capture trigger input pins Capture trigger timer Timer flip-flop output pin Timer run register Timer mode register Timer flip-flop control register TBCRG0L (0xFFFF_F208) TBDRG0L (0xFFFF_F218) TBDRG1L (0xFFFF_F21A) TBCRUN (0xFFFF_F200) TBCMOD (0xFFFF_F202) TBDRUN (0xFFFF_F210) TBDMOD (0xFFFF_F212) TA5OUT TA5OUT
Channel TMRBC TMRBD
External pins
Register name Timer registers (address)
TBCRG0H (0xFFFF_F209) TBDRG0H (0xFFFF_F219) TBCRG1L (0xFFFF_F20A) TBCRG1H (0xFFFF_F20B) TBDRG1H (0xFFFF_F21B) TBCCP0L (0xFFFF_F20C) TBDCP0L (0xFFFF_F21C) TBDCP1L (0xFFFF_F21E) TBDCP1H (0xFFFF_F21F)
Capture registers
TBCCP0H (0xFFFF_F20D) TBDCP0H (0xFFFF_F21D) TBCCP1L (0xFFFF_F20E) TBCCP1H (0xFFFF_F20F)
TMP1942CY/CZ-192
3.10.1
Internal Data Bus
Internal Data Bus
Block Diagrams
Prescaler Clock Source: T0 2 T2 Capture Register 0 TB0CP0H/L TB0MOD TB0RUN TB0MOD Counter Clock 16-bit Up-Counter (UC0) Capture egister 1 TB0CP1H/L T8 4 8 16
run/ clear TB0RUN
TA3OUT TB0IN0 TB0IN1 Capture & External Control Selector TB0MOD T0 T2 T8 TB0MOD
(From TMRA23)
Timer Flip Flop Control
Timer Flip Flop TB0FF0
Timer Flip Flop Output TB0OUT
TMRB0 Interrupt INTTB0
Figure 3.10.1 TMRB0/1 and TMRB to TMRBD Block Diagram
Match Detect
TMP1942CY/CZ-193
16-bit Comparator (CP0) Match Detect 16-bit Timer Register TB0RG0H/L TB0RUN Register Buffer 0 Internal Data Bus
Over-Flow IInterrupt Output
Register 1 Interrupt Output
Register 0 Interrupt Output
16-bit Comparator (CP1) 16-bit Timer Register TB0RG1H/L
16-bit Timer Status Register TB0ST
TX1942CY/CZ
Internal Data Bus
Internal Data Bus run/ clear 2 T2 TB2MOD TB2MOD TB2RUN TB2MOD 16-bit Up Down Counter (UC0) Timer Flip Flop Control Capture Register 0 TB2CP0H/L Capture Register 1 TB2CP1H/L T8 Timer Flip Flop TB2FF0 4 8 16 TB2RUN
Internal Data Bus
Prescaler Clock Source: T0
TA3OUT (From TMRA23) TB2IN0 TB2IN1 Capture & External Interrupt TB2RUN Selector Count Up-Down Control
Timer Flip Flop Control Output TB2OUT
Figure 3.10.2 TMRB2/3 Block Diagram
TMRB2 Interrupt INTTB2
TMP1942CY/CZ-194
16-bit Comperator (CP0) 16-bit Timer Register TB2RG0H/L Match Detect TB2RUN Register Buffer 0 Internal Data Bus
Up-Down Interrupt Output
Over Flow Interrupt Output
Register 0 Interrupt Output
Register 1 Interrupt Output
Under Flow Interrupt Output Match Detect 16-bit Comparator (CP1) 16-bit Timer Register TB2RG1H/L Internal Data Bus
TX1942CY/CZ
16-bit Timer Status Register TB2ST
TX1942CY/CZ 3.10.2 Function description of each circuit
(1) Prescaler The TMP1942 has a 5-bit prescaler to supply a clock to TMRB0. The prescaler's input clock T0 has a frequency of fperiph, fperiph/2, or fperiph/4 as selected by SYSCR0 in the CG block. Fperiph is either the clock fgear as selected by SYSCR1 in the CG block or the clock fc before division by the clock gear. The prescaler is set to either run or stop by TA01RUN. Writing a 1 to this bit causes the prescaler to start counting and writing 0 causes it to clear itself and stop counting. Table 3.10.5 shows the resolutions of the prescaler output clocks. Table 3.10.5 Prescaler Output Clock Resolutions
@fc = 32 MHz
Peripheral Clock Selection
Selected Clock Gear Value Prescaler Clock
00 (fperiph/4) 00 (fc) 01 (fperiph/2) 10 (fperip) 00 (fperiph/4) 01 (fc/2) 01 (fperiph/2) 10 (fperip) 00 (fperiph/4) 10 (fc/4) 01 (fperiph/2) 10 (fperip) 00 (fperiph/4) 11 (fc/8) 01 (fperiph/2) 10 (fperip) 00 (fperiph/4) 00 (fc) 01 (fperiph/2) 10 (fperip) 00 (fperiph/4) 01 (fc/2) 01 (fperiph/2) 10 (fperip) 00 (fperiph/4) 10 (fc/4) 01 (fperiph/2) 10 (fperip) 00 (fperiph/4) 11 (fc/8) 01 (fperiph/2) 10 (fperip)
3 3 2 3 2
Prescaler Output Clock Resolution
T1
fc/2 (0.25 s) fc/2 (0.125 s)
T4
fc/2 (1.0 s)
5 4
T16
fc/2 (4.0 s)
7 6 5 8 7 6
fc/2 (0.5 s) fc/2 (0.25 s)
3
fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (8.0 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (16 s)
9
fc/2 (0.5 s)
4
fc/2 (2.0 s)
6 5 4 7 6 5 8 7 6 5 4
fc/2 (0.25 s)
3
fc/2 (1.0 s) fc/2 (0.5 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (8.0 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (0.5 s) fc/2 (0.25 s)
3
0 (fgear)
fc/2 (1.0 s)
5 4
fc/2 (0.5 s)
fc/2 (8.0 s)
8 7
fc/2 (4.0 s) fc/2 (32 s)
10 9
fc/2 (2.0 s)
6 5
fc/2 (1.0 s)
fc/2 (16 s) fc/2 (8.0 s)
8 7 6 5 7 6
fc/2 (0.25 s) fc/2 (0.125 s)
fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/25 (1.0 s) fc/2 (4.0 s)
7 6 5 7 6 5
fc/2 (0.25 s)

fc/2 (1.0 s)
5 4
fc/2 (0.5 s) fc/2 (0.25 s)
3
1 (fc)
fc/2 (1.0 s)
5 4
fc/2 (0.5 s)
fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (1.0 s)
fc/2 (1.0 s)
5

Note 1: The prescaler's output clock Tn must be selected such that the relationship Tn < fsys/2 is satisfied (i.e., Tn must be slower than fsys/2). Note 2: Do not change the clock gear value while the timer is running. Note 3: The -- character means "Don't use".
TMP1942CY/CZ-195
TX1942CY/CZ
(2) Up-counter (UC0) UC0 is a 16-bit binary counter which counts up synchronously with the input clock selected by TB0MOD. The input clock for UC0 is either the external clock entered via the TB0IN0 pin or one of the three prescaler output clocks, T1, T4 or T16. The setting of TB0RUN either causes the up-counter UC0 to count, or stops and clears it. If the value in the up-counter UC0 matches the value in the timer register TB0RG1H/L while clearing is enabled, UC0 is cleared to 0. Clearing of UC0 can be enabled or disabled by setting TB0MOD accordingly. If clearing is disabled, the counter functions as a free-running counter. In addition, when UC0 overflows, it generates an overflow interrupt INTTB01. TMRB2 and TMRB3 support the 2-phase pulse input counter feature. When 2-phase pulse counter mode is selected with the setting of TB2RUN, UC0 functions as an up/down-counter with an initial value of 0x7FFF. When the counter overflows, it is reloaded with an initial value of 0x0000. When the counter underflows, it is reloaded with an initial value of 0xFFFF. UC0 only functions as an up-counter in other modes. Note: Programming the TB0CLK[1:0] and TB0CLE bits in the TB0MOD register should only be attempted when the timer is not running. (3) Timer registers (TB0RG0H/L and TB0RG1H/L) Each channel incorporates two 16-bit registers used to set a counter value. When the value set in one of these timer registers matches the value of up-counter UC0, the comparator's match detection signal becomes active. Timer registers TB0RG0H/L and TB0RG1H/L can be written in a single operation using a 2-byte data transfer instruction, or in two operations (the eight low-order bits first and then the eight high-order bits) using a 1-byte data transfer instruction. The timer register TB0RG0 has a double-buffer structure, being paired with register buffer 0. The setting of TB0RUN enables or disables the register's double-buffer facility. The double-buffer is disabled when = 0 and enabled when = 1. When the double-buffer is enabled, data transfer from register buffer 0 to the timer register TB0RG0 is initiated by a match of UC0 and TB0RG1. When reset, the contents of the timer registers TB0RG0 and TB0RG1 are undefined; hence, data must be written to the timer registers before the 16-bit timers can be used. A reset initializes TB0RUN to 0, disabling the double-buffer. To use the double-buffer, write data to the timer registers and set to 1, then write the following data in the register buffer. TB0RG0 and its register buffer both have the same addresses, 0xFFFF_F188 and 0xFFFF_F189, allocated to them. When = 0, the same value is written to TB0RG0 and its register buffer; when = 1, the value is only written to the register buffer. Therefore, the register buffer must be disabled before the initial value is written to the timer register. Note: Programming the TB0RDE bit should only be attempted when the timer is not running.
TMP1942CY/CZ-196
TX1942CY/CZ
(4) Capture registers (TB0CP0H/L and TB0CP1H/L) TB0CP0H/L and TB0CP1H/L are 16-bit registers used to latch the value of the up-counter UC0. Data may be read out from a capture register in a single operation using a 2-byte data transfer instruction, or in two operations (the eight low-order bits first and then the eight high-order bits) using a 1-byte data transfer instruction. (5) Capture controller This circuit controls the timing at which the value in the up-counter UC0 is latched into the capture registers (TB0CP0 and TB0CP1). The capture register latch timing is set using TB0MOD. In addition, the value of the up-counter UC0 can be latched into the capture registers by software. Each time TB0MOD is set to 0, the UC0 value at that point is latched into TB0CP0. Before this function can be used, the prescaler must be placed in the Run state by setting TB0RUN to 1. In 2-phase pulse counter mode (only for TMRB2 and TMRB3), the counter value is latched by software capture.
Note1: Reading the eight low-order bits of the capture register disables capture operation. Subsequently reading the eight high-order bits of the capture register enables capture operation. Note2: If the timer is stopped when only the eight low-order bits have been read, capture operation is not enabled even after the timer is restarted. Do not stop the timer until both the eight low-order and eight high-order bits are read. Note3: When the TB0IN0 pin is selected as a capture trigger input, it can not function as a timer clock. (6) Comparators (CP0 and CP1) The two 16-bit comparators compare the value of the up-counter UC0 with the values set in the timer registers TB0RG0 and TB0RG1 to detect a match. If the value in either TB0RG0 or TB0RG1 matches the value in UC0, the corresponding comparator generates an INTTB0 interrupt. (7) Timer flip-flop (TB0FF0) The timer flip-flop TB0FF0 is designed to be inverted by a match detection signal from the comparator or by a latch signal to the capture registers. Inversion can be enabled or disabled by setting TB0FFCR accordingly. When reset, the TB0FF0 value is undefined. Writing 00 to TB0FFCR inverts the value of the flip-flop; writing 01 to TB0FFCR sets the flip-flop to 1; writing 10 to TB0FFCR clears the flip-flop to 0. The TB0FF0 value can be forwarded to the timer output pin, TB0OUT (shared with PA2). When timer output is needed, this pin must be set for that purpose by using the port A registers PACR and PAFC. Note: Programming the TB0FF0C1[1:0] field should only be attempted when the timer is not running.
TMP1942CY/CZ-197
TX1942CY/CZ 3.10.3 Register description
TMRB0 run register
7 TB0RUN (0xFFFF_ F140) Bit symbol Read/Write After reset TB0RDE R/W 0 Double Buffer 0: Disable 1: Enable 6
5

4
3 I2TB0 R/W 0
2 TB0PRUN R/W 0
1

0 TB0RUN R/W 0
R/W 0 Must always be set to 0.
R/W 0 Must always be set to 0.
Function
IDLE Timer Run/Stop Control 0: Idle 0: Stop and cleared 1: Operate 1: Count
I2TB0: Operation in IDLE mode TB0PRUN: Operation of the prescaler TB0RUN: Operation of timer B0
Note: TB0RUN bits 1 and 5 are undefined when read.
TMRB1 run register
7 TB1RUN (0xFFFF_ F150) Bit symbol Read/Write After reset TB1RDE R/W 0 Double Buffer 0: Disable 1: Enable 6
5

4
3 I2TB1 R/W 0
2 TB1PRUN R/W 0
1

0 TB1RUN R/W 0
R/W 0 Must always be set to 0.
R/W 0
Function
Must IDLE 16-Bit Timer Run/Stop Control always be 0: Idle 0: Stop and cleared set to 0. 1: Operate 1: Count
I2TB1: Operation in IDLE mode TB1PRUN: Operation of the prescaler TB1RUN: Operation of timer B1
Note: TB1RUN bits 1 and 5 are undefined when read.
Figure 3.10.3 TMRB Registers
TMP1942CY/CZ-198
TX1942CY/CZ
TMRB2 run register 7
TB2RUN (0xFFFF_ F160) Bit symbol Read/Write After reset TB2RDE R/W 0 Double Buffer 0: Disable 1: Enable
6
5
UD2CK R/W 0 Sampling clock 0: fs 1: fsys/2
4
TB2UDCE R/W 0 2-phase counter enable 0: Disable 1: Enable I2TB2: TB2PRUN: TB2RUN: TB2UDCE: UD2CK:
3
I2TB2 R/W 0
2
TB2PRUN R/W 0
1
0
TB2RUN R/W 0
R/W 0 Must always be set to 0.
Function
IDLE Timer Run/Stop Control 0: Idle 0: Stop and cleared 1: Operate 1: Count
Operation in IDLE mode Operation of the prescaler Operation of timer B2 Operation of the 2-phase pulse input counter Sampling clock selection for 2-phase pulse input
Note 1: TB2RUN bits 1 and 5 are undefined when read. Note 2: Setting TB2RUN bit 4 to 1 selects 2-phase pulse input counter mode, causing the counter to operate as an up/down-counter. Clearing the bit to 0 restores normal timer mode, causing the timer to operate as an up-counter.
TMRB3 run register
7 TB3RUN (0xFFFF_ F170) Bit symbol Read/Write After reset TB3RDE R/W 0 Double Buffer 0: Disable 1: Enable 6
5 UD3CK R/W 0 Sampling clock 0: fs 1: fsys/2
4 TB3UDCE R/W 0 2-phase counter enable 0: Disable 1: Enable I2TB3: TB3PRUN: TB3RUN: TB3UDCE: UD3CK:
3 I2TB3 R/W 0
2 TB3PRUN R/W 0
1

0 TB3RUN R/W 0
R/W 0 Must always be set to 0.
Function
IDLE 16-Bit Timer Run/Stop Control 0: Idle 0: Stop and cleared 1: Operate 1: Count
Operation in IDLE mode Operation of the prescaler Operation of timer B3 Operation of the 2-phase pulse input counter Sampling clock selection for 2-phase pulse input
Note 1: TB3RUN bits 1 and 5 are undefined when read. Note 2: Setting TB3RUN bit 4 to 1 selects 2-phase pulse input counter mode, causing the counter to operate as an up/down-counter. Clearing the bit to 0 restores normal timer mode, causing the timer to operate as an up-counter. Figure 3.10.4 TMRB Registers
TMP1942CY/CZ-199
TX1942CY/CZ
TMRB4 run register
7 TB4RUN (0xFFFF_ F180) Bit symbol Read/Write After reset TB4RDE R/W 0 Double Buffer 0: Disable 1: Enable 6
5

4
3 I2TB4 R/W 0
2 TB4PRUN R/W 0
1

0 TB4RUN R/W 0
R/W 0 Must always be set to 0.
R/W 0
Function
Must IDLE 16-Bit Timer Run/Stop Control always be 0: Idle 0: Stop and cleared set to 0. 1: Operate 1: Count
I2TB4: Operation in IDLE mode TB4PRUN: Operation of the prescaler TB4RUN: Operation of timer B4
Note: TB4RUN bits 1 and 5 are undefined when read.
TMRB5 run register
7 TB5RUN (0xFFFF_ F190) Bit symbol Read/Write After reset TB5RDE R/W 0 Double Buffer 0: Disable 1: Enable 6
5

4
3 I2TB5 R/W 0
2 TB5PRUN R/W 0
1

0 TB5RUN R/W 0
R/W 0 Must always be set to 0.
R/W 0
Function
Must IDLE 16-Bit Timer Run/Stop Control always be 0: Idle 0: Stop and cleared set to 0. 1: Operate 1: Count
I2TB5: Operation in IDLE mode TB5PRUN: Operation of the prescaler TB5RUN: Operation of timer B5
Note: TB5RUN bits 1 and 5 are undefined when read.
TMRB6 run register
7 TB6RUN (0xFFFF_ F1A0) Bit symbol Read/Write After reset TB6RDE R/W 0 Double Buffer 0: Disable 1: Enable 6
5

4
3 I2TB6 R/W 0
2 TB6PRUN R/W 0
1

0 TB6RUN R/W 0
R/W 0 Must always be set to 0.
R/W 0 Must always be set to 0.
Function
IDLE 16-Bit Timer Run/Stop Control 0: Idle 0: Stop and cleared 1: Operate 1: Count
I2TB6: Operation in IDLE mode TB6PRUN: Operation of the prescaler TB6RUN: Operation of timer B6
Note: TB6RUN bits 1 and 5 are undefined when read. Figure 3.10.5 TMRB Registers
TMP1942CY/CZ-200
TX1942CY/CZ
TMRB7 run register
7 TB7RUN (0xFFFF_ F1B0) Bit symbol Read/Write After reset TB7RDE R/W 0 Double Buffer 0: Disable 1: Enable 6
5

4

3 I2TB7 R/W 0
2 TB7PRUN R/W 0
1

0 TB7RUN R/W 0
R/W 0 Must always be set to 0.
Function
Must always be set to 0.
IDLE 16-Bit Timer Run/Stop Control 0: Idle 0: Stop and cleared 1: Operate 1: Count
I2TB7: Operation in IDLE mode TB7PRUN: Operation of the prescaler TB7RUN: Operation of timer B7
Note: TB7RUN bits 1 and 5 are undefined when read. TMRB8 run register
7 TB8RUN (0xFFFF_ F1C0) Bit symbol Read/Write After reset TB8RDE R/W 0 Double Buffer 0: Disable 1: Enable 6
5

4

3 I2TB8 R/W 0
2 TB8PRUN R/W 0
1

0 TB8RUN R/W 0
R/W 0 Must always be set to 0.
Function
Must always be set to 0.
IDLE 16-Bit Timer Run/Stop Control 0: Idle 0: Stop and cleared 1: Operate 1: Count
I2TB8: Operation in IDLE mode TB8PRUN: Operation of the prescaler TB8RUN: Operation of timer B8
Note: TB8RUN bits 1 and 5 are undefined when read.
TMRB9 run register
7 TB9RUN (0xFFFF_ F1D0) Bit symbol Read/Write After reset TB9RDE R/W 0 Double Buffer 0: Disable 1: Enable 6
5

4

3 I2TB9 R/W 0
2 TB9PRUN R/W 0
1

0 TB9RUN R/W 0
R/W 0 Must always be set to 0.
Function
Must always be set to 0.
IDLE 16-Bit Timer Run/Stop Control 0: Idle 0: Stop and cleared 1: Operate 1: Count
I2TB9: Operation in IDLE mode TB9PRUN: Operation of the prescaler TB9RUN: Operation of timer B9
Note: TB9RUN bits 1 and 5 are undefined when read. Figure 3.10.6 TMRB Registers
TMP1942CY/CZ-201
TX1942CY/CZ
TMRBA run register
7 TBARUN (0xFFFF_ F1E0) Bit symbol Read/Write After reset TBARDE R/W 0 Double Buffer 0: Disable 1: Enable 6
5

4

3 I2TBA R/W 0
2 TBAPRUN R/W 0
1

0 TBARUN R/W 0
R/W 0 Must always be set to 0.
Function
Must always be set to 0.
IDLE 16-Bit Timer Run/Stop Control 0: Idle 0: Stop and cleared 1: Operate 1: Count
I2TBA: Operation in IDLE mode TBAPRUN: Operation of the prescaler TBARUN: Operation of timer BA
Note: TBARUN bits 1 and 5 are undefined when read.
TMRBB run register
7 TBBRUN (0xFFFF_ F1F0) Bit symbol Read/Write After reset TBBRDE R/W 0 Double Buffer 0: Disable 1: Enable 6
5

4

3 I2TBB R/W 0
2 TBBPRUN R/W 0
1

0 TBBRUN R/W 0
R/W 0 Must always be set to 0.
Function
Must always be set to 0.
IDLE 16-Bit Timer Run/Stop Control 0: Idle 0: Stop and cleared 1: Operate 1: Count
I2TBB: Operation in IDLE mode TBBPRUN: Operation of the prescaler TBBRUN: Operation of timer BB
Note: TBBRUN bits 1 and 5 are undefined when read.
TMRBC run register
7 TBCRUN (0xFFFF_ F200) Bit symbol Read/Write After reset TBCRDE R/W 0 Double Buffer 0: Disable 1: Enable 6
5

4

3 I2TBC R/W 0
2 TBCPRUN R/W 0
1

0 TBCRUN R/W 0
R/W 0 Must always be set to 0.
Function
Must always be set to 0.
IDLE 16-Bit Timer Run/Stop Control 0: Idle 0: Stop and cleared 1: Operate 1: Count
I2TBC: Operation in IDLE mode TBCPRUN: Operation of the prescaler TBCRUN: Operation of timer BC
Note: TBCRUN bits 1 and 5 are undefined when read. Figure 3.10.7 TMRB Registers
TMP1942CY/CZ-202
TX1942CY/CZ
TMRBD run register
7 TBDRUN (0xFFFF_ F210) Bit symbol Read/Write After reset TBDRDE R/W 0 Double Buffer 0: Disable 1: Enable 6
5

4

3 I2TBD R/W 0
2 TBDPRUN R/W 0
1

0 TBDRUN R/W 0
R/W 0 Must always be set to 0.
Function
Must always be set to 0.
IDLE 16-Bit Timer Run/Stop Control 0: Idle 0: Stop and cleared 1: Operate 1: Count
I2TBD: Operation in IDLE mode TBDPRUN: Operation of the prescaler TBDRUN: Operation of timer BD
Note: TBDRUN bits 1 and 5 are undefined when read. Figure 3.10.8 TMRB Registers
TMP1942CY/CZ-203
TX1942CY/CZ
TMRB0 mode register
7 TB0MOD (0xFFFF_ F142) Bit symbol Read/Write After reset 0

6
5 TB0CP0 W 1
Software capture control 0: Software capture 1: Don't care
4
3
2 TB0CLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TB0CLK1 0
0 TB0CLK0 0
TB0CPM1 TB0CPM0 0 0
0
Must always be set to 00.
Function
Capture timing 00: Disabled 01: TB0IN0 TB0IN1 10: TB0IN0 TB0IN0 11: TA3OUT TA3OUT
Source clock selection 00: TB0IN0 pin input 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 Clearing of up-counter disabled Up-counter cleared when it matches TB0RG1 Capture control 00 01 10 11 Capture disabled Latches value into TB0CP0 at rise of TB0IN0. Latches value into TB0CP1 at rise of TB0IN1. Latches value into TB0CP0 at rise of TB0IN0. Latches value into TB0CP1 at fall of TB0IN0. Latches value into TB0CP0 at rise of TA3OUT. Latches value into TB0CP1 at fall of TA3OUT. Latches up-counter value into TB0CP0. Don't care
Capture timing
Software capture 0 1
TMRB1 mode register
7 TB1MOD (0xFFFF_ F152) Bit symbol Read/Write After reset 0
6
5 TB1CP0 W* 1
Software capture control 0: Software capture 1: Don't care
4
3
2 TB1CLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TB1CLK1 0
0 TB1CLK0 0
TB1CPM1 TB1CPM0 0 0
R/W 0
Must always be set to 00.
Function
Capture timing 00: Disabled 01: TB1N0 TB1IN1 10: TB1IN0 TB1IN0 11: TA3OUT TA3OUT
Source clock selection 00: TB1IN0 pin input 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 Clearing of up-counter disabled Up-counter cleared when it matches TB1RG1
Capture timing Capture control 00 01 10 11 Capture disabled Latches value into TB1CP0 at rise of TB1IN0. Latches value into TB1CP1 at rise of TB1IN1. Latches value into TB1CP0 at rise of TB1IN0. Latches value into TB1CP1 at fall of TB1IN0. Latches value into TB1CP0 at rise of TA3OUT. Latches value into TB1CP1 at fall of TA3OUT. Latches up-counter value into TB1CP0. Don't care
Software capture 0 1
Figure 3.10.9 TMRB Registers
TMP1942CY/CZ-204
TX1942CY/CZ
TMRB2 mode register
7 TB2MOD (0xFFFF_ F162) Bit symbol Read/Write After reset 0

6
5 TB2CP0 W* 1
Software capture control 0: Software capture 1: Don't care
4 TB2CPM1 0
3 TB2CPM0 0
2 TB2CLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TB2CLK1 0
0 TB2CLK0 0
0
Must always be set to 00.
Function
Capture timing 00: Disabled 01: TB2IN0 TB2IN1 10: TB2IN0 TB2IN0 11: TA3OUT TA3OUT
Source clock selection 00: TB2IN0 pin input 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 Clearing of up-counter disabled Up-counter cleared when it matches TB2RG1
Capture timing Capture control 00 01 10 11 Capture disabled Latches value into TB2CP0 at rise of TB2IN0. Latches value into TB2CP1 at rise of TB2IN1. Latches value into TB2CP0 at rise of TB2IN0. Latches value into TB2CP1 at fall of TB2IN0. Latches value into TB2CP0 at rise of TA3OUT. Latches value into TB2CP1 at fall of TA3OUT. Latches up-counter value into TB2CP0. Don't care
Software capture 0 1
TMRB3 mode register
7 TB3MOD (0xFFFF_ F172) Bit symbol Read/Write After reset 0

6
5 TB3CP0 W* 1
Software capture control 0: Software capture 1: Don't care
4 TB3CPM1 0
3 TB3CPM0 0
2 TB3CLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TB3CLK1 0
0 TB3CLK0 0
0
Must always be set to 00.
Function
Capture timing 00: Disabled 01: TB3IN0 TB3IN1 10: TB3IN0 TB3IN0 11: TA3OUT TA3OUT
Source clock selection 00: TB3IN0 pin input 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 Clearing of up-counter disabled Up-counter cleared when it matches TB3RG1
Capture timing Capture control 00 01 10 11 Capture disabled Latches value into TB3CP0 at rise of TB3IN0. Latches value into TB3CP1 at rise of TB3IN1. Latches value into TB3CP0 at rise of TB3IN0. Latches value into TB3CP1 at fall of TB3IN0. Latches value into TB3CP0 at rise of TA3OUT. Latches value into TB3CP1 at fall of TA3OUT.
Software capture 0 1 Latches up-counter value into TB3CP0. Don't care
Figure 3.10.10 TMRB Registers
TMP1942CY/CZ-205
TX1942CY/CZ
TMRB4 mode register
7 TB4MOD (0xFFFF_ F182) Bit symbol Read/Write After reset 0

6
5 TB4CP0 W* 1
Software capture control 0: Software capture 1: Don't care
4 TB4CPM1 0
3 TB4CPM0 0
2 TB4CLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TB4CLK1 0
0 TB4CLK0 0
0
Must always be set to 00.
Function
Capture timing 00: Disabled 01: TB4IN0 TB4IN1 10: TB4IN0 TB4IN0 11: TA3OUT TA3OUT
Source clock selection 00: TB4IN0 pin input 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 Clearing of up-counter disabled Up-counter cleared when it matches TB4RG1
Capture timing Capture control 00 01 10 11 Capture disabled Latches value into TB4CP0 at rise of TB4IN0. Latches value into TB4CP1 at rise of TB4IN1. Latches value into TB4CP0 at rise of TB4IN0. Latches value into TB4CP1 at fall of TB4IN0. Latches value into TB4CP0 at rise of TA3OUT. Latches value into TB4CP1 at fall of TA3OUT.
Software capture 0 1 Latches up-counter value into TB4CP0. Don't care
TMRB5 mode register
7 TB5MOD (0xFFFF_ F192) Bit symbol Read/Write After reset 0

6
5 TB5CP0 W* 1
Software capture control 0: Software capture 1: Don't care
4 TB5CPM1 0
3 TB5CPM0 0
2 TB5CLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TB5CLK1 0
0 TB5CLK0 0
0
Must always be set to 00.
Function
Capture timing 00: Disabled 01: Setting prohibited 10: Setting prohibited 11: TA3OUTTA3OUT
Source clock selection 00: Setting prohibited 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 Clearing of up-counter disabled Up-counter cleared when it matches TB5RG1
Capture timing 00 01 10 11 Capture disabled Capture disabled Capture disabled Latches value into TB5CP0 at rise of TA3OUT. Latches value into TB5CP1 at fall of TA3OUT.
Software capture 0 1 Latches up-counter value into TB5CP0. Don't care
Figure 3.10.11 TMRB Registers
TMP1942CY/CZ-206
TX1942CY/CZ
TMRB6 mode register
7 TB6MOD (0xFFFF_ F1A2) Bit symbol Read/Write After reset 0

6
5 TB6CP0 W* 1
Software capture control 0: Software capture 1: Don't care
4 TB6CPM1 0
3 TB6CPM0 0
2 TB6CLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TB6CLK1 0
0 TB6CLK0 0
0
Must always be set to 00.
Function
Capture timing 00: Disabled 01: Setting prohibited 10: Setting prohibited 11: TA3OUTTA3OUT
Source clock selection 00: Setting prohibited 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 Clearing of up-counter disabled Up-counter cleared when it matches TB6RG1
Capture timing 00 01 10 11 Capture disabled Capture disabled Capture disabled Latches value into TB6CP0 at rise of TA3OUT. Latches value into TB6CP1 at fall of TA3OUT.
Software capture 0 1 Latches up-counter value into TB6CP0. Don't care
TMRB7 mode register
7 TB7MOD (0xFFFF_ F1B2) Bit symbol Read/Write After reset 0

6
5 TB7CP0 W* 1
Software capture control 0: Software capture 1: Don't care
4 TB7CPM1 0
3 TB7CPM0 0
2 TB7CLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TB7CLK1 0
0 TB7CLK0 0
0
Must always be set to 00.
Function
Capture timing 00: Disabled 01: TB7IN0 TB7IN1 10: TB7IN0 TB7IN0 11: TA3OUT TA3OUT
Source clock selection 00: TB7IN0 pin input 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 Clearing of up-counter disabled Up-counter cleared when it matches TB7RG1
Capture timing 00 01 10 11 Capture disabled Latches value into TB7CP0 at rise of TB7IN0. Latches value into TB7CP1 at rise of TB7IN1. Latches value into TB7CP0 at rise of TB7IN0. Latches value into TB7CP1 at fall of TB7IN0. Latches value into TB7CP0 at rise of TA3OUT. Latches value into TB7CP1 at fall of TA3OUT.
Software capture 0 1 Latches up-counter value into TB7CP0. Don't care
Figure 3.10.12 TMRB Registers
TMP1942CY/CZ-207
TX1942CY/CZ
TMRB8 mode register
7 TB8MOD (0xFFFF_ F1C2) Bit symbol Read/Write After reset 0

6
5 TB8CP0 W* 1
Software capture control 0: Software capture 1: Don't care
4 TB8CPM1 0
3 TB8CPM0 0
2 TB8CLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TB8CLK1 0
0 TB8CLK0 0
0
Must always be set to 00.
Function
Capture timing 00: Disabled 01: TB8IN0 TB8IN1 10: TB8IN0 TB8IN0 11: TA5OUT TA5OUT
Source clock selection 00: TB8IN0 pin input 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 00 01 10 11 Clearing of up-counter disabled Up-counter cleared when it matches TB8RG1 Capture disabled Latches value into TB8CP0 at rise of TB8IN0. Latches value into TB8CP1 at rise of TB8IN1. Latches value into TB8CP0 at rise of TB8IN0. Latches value into TB8CP1 at fall of TB8IN0. Latches value into TB8CP0 at rise of TA5OUT. Latches value into TB8CP1 at fall of TA5OUT.
Capture timing
Software capture 0 1 Latches up-counter value into TB8CP0. Don't care
TMRB9 mode register
7 TB9MOD (0xFFFF_ F1D2) Bit symbol Read/Write After reset 0

6
5 TB9CP0 W* 1
Software capture control 0: Software capture 1: Don't care
4 TB9CPM1 0
3 TB9CPM0 0
2 TB9CLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TB9CLK1 0
0 TB9CLK0 0
0
Must always be set to 00.
Function
Capture timing 00: Disabled 01: TB9IN0 TB9IN1 10: TB9IN0 TB9IN0 11: TA5OUT TA5OUT
Source clock selection 00: TB9IN0 pin input 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 Clearing of up-counter disabled Up-counter cleared when it matches TB9RG1
Capture timing 00 01 10 11 Capture disabled Latches value into TB9CP0 at rise of TB9IN0. Latches value into TB9CP1 at rise of TB9IN1. Latches value into TB9CP0 at rise of TB9IN0. Latches value into TB9CP1 at fall of TB9IN0. Latches value into TB9CP0 at rise of TA5OUT. Latches value into TB9CP1 at fall of TA5OUT.
Software capture 0 1 Latches up-counter value into TB9CP0. Don't care
Figure 3.10.13 TMRB Registers
TMP1942CY/CZ-208
TX1942CY/CZ
TMRBA mode register
7 TBAMOD (0xFFFF_ F1E2) Bit symbol Read/Write After reset 0

6
5 TBACP0 W* 1
Software capture control 0: Software capture 1: Don't care
4
3
2 TBACLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TBACLK1 0
0 TBACLK0 0
TBACPM1 TBACPM0 0 0
0
Must always be set to 00.
Function
Capture timing 00: Disabled 01: TBAIN0 TBAIN1 10: TBAIN0 TBAIN0 11: TA5OUT TA5OUT
Source clock selection 00: TBAIN0 pin input 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 Clearing of up-counter disabled Up-counter cleared when it matches TBARG1
Capture timing 00 01 10 11 Capture disabled Latches value into TBACP0 at rise of TBAIN0. Latches value into TBACP1 at rise of TBAIN1. Latches value into TBACP0 at rise of TBAIN0. Latches value into TBACP1 at fall of TBAIN0. Latches value into TBACP0 at rise of TA5OUT. Latches value into TBACP1 at fall of TA5OUT.
Software capture 0 1 Latches up-counter value into TBACP0. Don't care
TMRBB mode register
7 TBBMOD (0xFFFF_ F1F2) Bit symbol Read/Write After reset 0

6
5 TBBCP0 W* 1
Software capture control 0: Software capture 1: Don't care
4
3
2 TBBCLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TBBCLK1 0
0 TBBCLK0 0
TBBCPM1 TBBCPM0 0 0
0
Must always be set to 00.
Function
Capture timing 00: Disabled 01: Setting prohibited 10: Setting prohibited 11: TA5OUT TA5OUT
Source clock selection 00: Setting prohibited 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 Clearing of up-counter disabled Up-counter cleared when it matches TBBRG1
Capture timing 00 01 10 11 Capture disabled Capture disabled Capture disabled Latches value into TBBCP0 at rise of TA5OUT. Latches value into TBBCP1 at fall of TA5OUT.
Software capture 0 1 Latches up-counter value into TBBCP0. Don't care
Figure 3.10.14 TMRB Registers
TMP1942CY/CZ-209
TX1942CY/CZ
TMRBC mode register
7 TBCMOD (0xFFFF_ F202) Bit symbol Read/Write After reset 0

6
5 TBCCP0 W* 1
Software capture control 0: Software capture 1: Don't care
4
3
2 TBCCLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TBCCLK1 0
0 TBCCLK0 0
TBCCPM1 TBCCPM0 0 0
0
Must always be set to 00.
Function
Capture timing 00: Disabled 01: Setting prohibited 10: Setting prohibited 11: TA5OUT TA5OUT
Source clock selection 00: Setting prohibited 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 Clearing of up-counter disabled Up-counter cleared when it matches TBCRG1
Capture timing 00 01 10 11 Capture disabled Capture disabled Capture disabled Latches value into TBCCP0 at rise of TA5OUT. Latches value into TBCCP1 at fall of TA5OUT.
Software capture 0 1 Latches up-counter value into TBCCP0. Don't care
TMRBD mode register
7 TBDMOD (0xFFFF_ F212) Bit symbol Read/Write After reset 0 0
Must always be set to 00.
6
5 TBDCP0 W* 1
Software capture control 0: Software capture 1: Don't care
4
3
2 TBDCLE R/W 0
Up-counter control 0: Clearing disabled 1: Clearing enabled
1 TBDCLK1 0
0 TBDCLK0 0
TBDCPM1 TBDCPM0 0 0
Function
Capture timing 00: Disabled 01: Disabled 10: Disabled 11: TA5OUT TA5OUT
Source clock selection 00: Setting prohibited 01: T1 10: T4 11: T16
Clearing up-counter (UC0) 0 1 Clearing of up-counter disabled Up-counter cleared when it matches TBDRG1
Capture timing 00 01 10 11 Capture disabled Capture disabled Capture disabled Latches value into TBDCP0 at rise of TA5OUT. Latches value into TBDCP1 at fall of TA5OUT.
Software capture 0 1 Latches up-counter value into TBDCP0. Don't care
Figure 3.10.15 TMRB Registers
TMP1942CY/CZ-210
TX1942CY/CZ
TMRB0 flip-flop control register
7 TB0FFCR (0xFFFF_ F143) Bit symbol Read/Write After reset 1
6
5 TB0C1T1 0
4 TB0C0T1 0 R/W
3 TB0E1T1 0
2 TB0E0T1 0
1 W* 1
0
TB0FF0C1 TB0FF0C0 1
W* 1
Must always be set to 11. TB0FF0 inversion trigger * These bits are always 11 0: Trigger disabled when read. 1: Trigger enabled
Function
When up-counter value is latched into TB0CP1
When up-counter value is latched into TB0CP0
When up-counter and TB0RG1 values match
When up-counter and TB0RG0 values match
TB0FF0 control 00: Invert 01: Set 10: Clear 11: Don't care * These bits are always 11 when read.
Control of timer flip-flop (TB0FF0) 00 TB0FF0 value inverted (soft inversion) 01 10 11 TB0FF0 set to 1 TB0FF0 set to 0 Don't care (read as 11)
Trigger for inverting timer flip-flop (TB0FF0) when up-counter and TB0RG0 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB0FF0) when up-counter and TB0RG1 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB0FF0) when up-counter value is latched into TB0CP0 0 Trigger disabled (inversion disabled) 1 Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB0FF0) when up-counter value is latched into TB0CP1 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Figure 3.10.16 TMRB Registers
TMP1942CY/CZ-211
TX1942CY/CZ
TMRB1 flip-flop control register
7 TB1FFCR (0xFFFF_ F153) Bit symbol Read/Write After reset 1
6
5 TB1C1T1 0
4 TB1C0T1 0 R/W
3 TB1E1T1 0
2 TB1E0T1 0
1 W* 1
0
TB1FF0C1 TB1FF0C0 1
W* 1
Must always be set to 11. TB1FF0 inversion trigger * These bits are always 11 0: Trigger disabled when read. 1: Trigger enabled
Function
When up-counter value is latched into TB1CP1
When up-counter value is latched into TB1CP0
When up-counter and TB1RG1 values match
When up-counter and TB1RG0 values match
TB1FF0 control 00: Invert 01: Set 10: Clear 11: Don't care * These bits are always 11 when read.
Control of timer flip-flop (TB1FF0) 00 01 10 11 TB1FF0 value inverted (soft inversion) TB1FF0 set to 1 TB1FF0 set to 0 Don't care (read as 11)
Trigger for inverting timer flip-flop (TB1FF0) when up-counter and TB1RG0 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB1FF0) when up-counter and TB1RG1 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB1FF0) when up-counter value is latched into TB1CP0 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB1FF0) when up-counter value is latched into TB1CP1 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Figure 3.10.17 TMRB Registers
TMP1942CY/CZ-212
TX1942CY/CZ
TMRB2 flip-flop control register
7 TB2FFCR (0xFFFF_ F163) Bit symbol Read/Write After reset 1
6
5 TB2C1T1 0
4 TB2C0T1 0 R/W
3 TB2E1T1 0
2 TB2E0T1 0
1 W* 1
0
TB2FF0C1 TB2FF0C0 1
W* 1
Must always be set to 11. TB2FF0 inversion trigger * These bits are always 11 0: Trigger disabled when read. 1: Trigger enabled
Function
When up-counter value is latched into TB2CP1
When up-counter value is latched into TB2CP0
When up-counter and TB2RG1 values match
When up-counter and TB2RG0 values match
TB2FF0 control 00: Invert 01: Set 10: Clear 11: Don't care * These bits are always 11 when read.
Control of timer flip-flop (TB2FF0) 00 01 10 11 TB2FF0 value inverted (soft inversion) TB2FF0 set to 1 TB2FF0 set to 0 Don't care (read as 11)
Trigger for inverting timer flip-flop (TB2FF0) when up-counter and TB2RG0 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB2FF0) when up-counter and TB2RG1 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB2FF0) when up-counter value is latched into TB2CP0 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB2FF0) when up-counter value is latched into TB2CP1 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Figure 3.10.18 TMRB Registers
TMP1942CY/CZ-213
TX1942CY/CZ
TMRB3 flip-flop control register
7 TB3FFCR (0xFFFF_ F173) Bit symbol Read/Write After reset 1
6
5 TB3C1T1 0
4 TB3C0T1 0 R/W
3 TB3E1T1 0
2 TB3E0T1 0
1 W* 1
0
TB3FF0C1 TB3FF0C0 1
W* 1
Must always be set to 11. TB3FF0 inversion trigger * These bits are always 11 0: Trigger disabled when read. 1: Trigger enabled
Function
When up-counter value is latched into TB3CP1
When up-counter value is latched into TB3CP0
When up-counter and TB3RG1 values match
When up-counter and TB3RG0 values match
TB3FF0 control 00: Invert 01: Set 10: Clear 11: Don't care * These bits are always 11 when read.
Control of timer flip-flop (TB3FF0) 00 01 10 11 TB3FF0 value inverted (soft inversion) TB3FF0 set to 1 TB3FF0 set to 0 Don't care (read as 11)
Trigger for inverting timer flip-flop (TB3FF0) when up-counter and TB3RG0 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB3FF0) when up-counter and TB3RG1 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB3FF0) when up-counter value is latched into TB3CP0 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB3FF0) when up-counter value is latched into TB3CP1 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Figure 3.10.19 TMRB Registers
TMP1942CY/CZ-214
TX1942CY/CZ
TMRB4 flip-flop control register
7 TB4FFCR (0xFFFF_ F183) Bit symbol Read/Write After reset 1
6
5 TB4C1T1 0
4 TB4C0T1 0 R/W
3 TB4E1T1 0
2 TB4E0T1 0
1 W* 1
0
TB4FF0C1 TB4FF0C0 1
W* 1
Must always be set to 11. TB4FF0 inversion trigger * These bits are always 11 0: Trigger disabled when read. 1: Trigger enabled
Function
When up-counter value is latched into TB4CP1
When up-counter value is latched into TB4CP0
When up-counter and TB4RG1 values match
When up-counter and TB4RG0 values match
TB4FF0 control 00: Invert 01: Set 10: Clear 11: Don't care * These bits are always 11 when read.
Control of timer flip-flop (TB4FF0) 00 01 10 11 TB4FF0 value inverted (soft inversion) TB4FF0 set to 1 TB4FF0 set to 0 Don't care (read as 11)
Trigger for inverting timer flip-flop (TB4FF0) when up-counter and TB4RG0 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB4FF0) when up-counter and TB4RG1 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB4FF0) when up-counter value is latched into TB4CP0 0 Trigger disabled (inversion disabled) 1 Trigger enabled (inversion enabled) Trigger for inverting timer flip-flop (TB4FF0) when up-counter value is latched into TB4CP1 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Figure 3.10.20 TMRB Registers
TMP1942CY/CZ-215
TX1942CY/CZ
TMRB5 flip-flop control register
7 TB5FFCR (0xFFFF_ F193) Bit symbol Read/Write After reset 1
6
5 TB5C1T1 0
4 TB5C0T1 0 R/W
3 TB5E1T1 0
2 TB5E0T1 0
1 W* 1
0
TB5FF0C1 TB5FF0C0 1
W* 1
Must always be set to 11. * These bits are always 11 when read. TB5FF0 inversion trigger 0: Trigger disabled 1: Trigger enabled When up-counter value is latched into TB5CP1
Function
When up-counter value is latched into TB5CP0
When up-counter and TB5RG1 values match
When up-counter and TB5RG0 values match
TB5FF0 control 00: Invert 01: Set 10: Clear 11: Don't care * These bits are always 11 when read.
Control of timer flip-flop (TB5FF0) 00 01 10 11 TB5FF0 value inverted (soft inversion) TB5FF0 set to 1 TB5FF0 set to 0 Don't care (read as 11)
Trigger for inverting timer flip-flop (TB5FF0) when up-counter and TB5RG0 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB5FF0) when up-counter and TB5RG1 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB5FF0) when up-counter value is latched into TB5CP0 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB5FF0) when up-counter value is latched into TB5CP1 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Figure 3.10.21 TMRB Registers
TMP1942CY/CZ-216
TX1942CY/CZ
TMRB6 flip-flop control register
7 TB6FFCR (0xFFFF_ F1A3) Bit symbol Read/Write After reset 1
6
5 TB6C1T1 0
4 TB6C0T1 0 R/W
3 TB6E1T1 0
2 TB6E0T1 0
1 W* 1
0
TB6FF0C1 TB6FF0C0 1
W* 1
Must always be set to 11. * These bits are always 11 when read. TB6FF0 inversion trigger 0: Trigger disabled 1: Trigger enabled When up-counter value is latched into TB6CP1
Function
When up-counter value is latched into TB6CP0
When up-counter and TB6RG1 values match
When up-counter and TB6RG0 values match
TB6FF0 control 00: Invert 01: Set 10: Clear 11: Don't care * These bits are always 11 when read.
Control of timer flip-flop (TB6FF0) 00 01 10 11 TB6FF0 value inverted (soft inversion) TB6FF0 set to 1 TB6FF0 set to 0 Don't care (read as 11)
Trigger for inverting timer flip-flop (TB6FF0) when up-counter and TB6RG0 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB6FF0) when up-counter and TB6RG1 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB6FF0) when up-counter value is latched into TB6CP0 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB6FF0) when up-counter value is latched into TB6CP1 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Figure 3.10.22 TMRB Registers
TMP1942CY/CZ-217
TX1942CY/CZ
TMRB7 flip-flop control register
7 TB7FFCR (0xFFFF_ F1B3) Bit symbol Read/Write After reset 1
6
5
TB7C1T1
4
TB7C0T1
3
TB7E1T1
2
TB7E0T1
1
TB7FF0C1
0
TB7FF0C0
W* 1 0 0
Must always be set to 11. * These bits are always 11 when read. TB7FF0 inversion trigger 0: Trigger disabled 1: Trigger enabled When up-counter value is latched into TB7CP1
R/W 0 0 1
W* 1
TB7FF0 control 00: Invert 01: Set 10: Clear 11: Don't care * These bits are always 11 when read.
Function
When up-counter value is latched into TB7CP0
When up-counter and TB7RG1 values match
When up-counter and TB7RG0 values match
Control of timer flip-flop (TB7FF0) 00 01 10 11 TB7FF0 value inverted (soft inversion) TB7FF0 set to 1 TB7FF0 set to 0 Don't care (read as 11)
Trigger for inverting timer flip-flop (TB7FF0) when up-counter and TB7RG0 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB7FF0) when up-counter and TB7RG1 values match 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB7FF0) when up-counter value is latched into TB7CP0 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Trigger for inverting timer flip-flop (TB7FF0) when up-counter value is latched into TB7CP1 0 1 Trigger disabled (inversion disabled) Trigger enabled (inversion enabled)
Figure 3.10.23 TMRB Registers
TMP1942CY/CZ-218
TX1942CY/CZ
TMRB0 status register
7 TB0ST (0xFFFF_ F144) Bit symbol Read/Write After reset

6

5

4

3

2 INTTBOF0 0
1 INTTB01 R 0
0 INTTB00 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTB00: INTTB01:
Interrupt generated upon detection of match with timer register TB0RG0
Interrupt generated upon detection of match with timer register TB0RG1 INTTBOF0: Interrupt generated upon detection of up-counter overflow
TMRB1 status register
7 TB1ST (0xFFFF_ F154) Bit symbol Read/Write After reset

6

5

4

3

2 INTTBOF1 0
1 INTTB11 R 0
0 INTTB10 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTB10: INTTB11:
Interrupt generated upon detection of match with timer register TB1RG0 Interrupt generated upon detection of match with timer register TB1RG1 upon detection of
INTTBOF1: Interrupt generated up-counter overflow
Figure 3.10.1 TMRB Registers
TMP1942CY/CZ-219
TX1942CY/CZ
TMRB2 status register a. When TB2RUN = 0: Normal timer mode
7 TB2ST (0xFFFF_ F164) Bit symbol Read/Write After reset

6

5

4

3

2 INTTBOF2 0
1 INTTB21 R 0
0 INTTB20 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTB20: INTTB21:
Interrupt generated upon detection of match with timer register TB2RG0
Interrupt generated upon detection of match with timer register TB2RG1 INTTBOF2: Interrupt generated upon detection of up-counter overflow
b.
TB2ST (0xFFFF_ F164)
When TB2RUN = 1: 2-phase pulse input counter mode
7 Bit symbol Read/Write After reset

6

5

4
INTTBUD2
3 R
2
1

0

INTTBUDF2 INTTBOUF2
0
Up or down count
0
Underflow 0: Not detected 1: Detected
0
Overflow 0: Not detected 1: Detected
Function
0: Not detected 1: Detected
INTTBUDF2: Interrupt generated upon detection of up-down counter underflow INTTBOVF2: Interrupt generated upon detection of up-down counter overflow INTTBUD2: Interrupt generated upon detection of up-down counter increment or decrement
Figure 3.10.25 TMRB Registers
TMP1942CY/CZ-220
TX1942CY/CZ
TMRB3 status register a. When TB3RUN = 0: Normal timer mode
7 TB3ST (0xFFFF_ F174) Bit symbol Read/Write After reset

6

5

4

3

2 INTTBOF3 0
1 INTTB31 R 0
0 INTTB30 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTB30: INTTB31:
Interrupt generated upon detection of match with timer register TB3RG0
Interrupt generated upon detection of match with timer register TB3RG1 INTTBOF3: Interrupt generated upon detection of up-counter overflow
b.
When TB3RUN = 1: 2-phase pulse input counter mode
7 6

5

4
INTTBUD3
3 R
2
1

0

TB3ST (0xFFFF_ F174)
Bit symbol Read/Write After reset

INTTBUDF3 INTTBOUF3
0
Up or down count
0
Underflow 0: Not detected 1: Detected
0
Overflow 0: Not detected 1: Detected
Function
0: Not detected 1: Detected
INTTBUDF3: Interrupt generated upon detection of up-down counter underflow INTTBOVF3: Interrupt generated upon detection of up-down counter overflow INTTBUD3: Interrupt generated upon detection of up-down counter increment or decrement
TMRB4 status register
7 TB4ST (0xFFFF_ F184) Bit symbol Read/Write After reset

6

5

4

3

2 INTTBOF4 0
1 INTTB41 R 0
0 INTTB40 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTB40: INTTB41:
Interrupt generated upon detection of match with timer register TB4RG0
Interrupt generated upon detection of match with timer register TB4RG1 INTTBOF4: Interrupt generated upon detection of up-counter overflow
Figure 3.10.26 TMRB Registers
TMP1942CY/CZ-221
TX1942CY/CZ
TMRB5 status register
7 TB5ST (0xFFFF_ F194) Bit symbol Read/Write After reset

6

5

4

3

2 INTTBOF4 0
1 INTTB41 R 0
0 INTTB40 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTB50: INTTB51:
Interrupt generated upon detection of match with timer register TB5RG0
Interrupt generated upon detection of match with timer register TB5RG1 INTTBOF5: Interrupt generated upon detection of up-counter overflow
TMRB6 status register
7 TB6ST (0xFFFF_ F1A4) Bit symbol Read/Write After reset

6

5

4

3

2 INTTBOF6 0
1 INTTB61 R 0
0 INTTB60 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTB60: INTTB61:
Interrupt generated upon detection of match with timer register TB6RG0 Interrupt generated upon detection of match with timer register TB6RG1 upon detection of
INTTBOF6: Interrupt generated up-counter overflow
TMRB7 status register
7 TB7ST (0xFFFF_ F1B4) Bit symbol Read/Write After reset

6

5

4

3

2 INTTBOF7 0
1 INTTB71 R 0
0 INTTB70 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTB70: INTTB71:
Interrupt generated upon detection of match with timer register TB7RG0 Interrupt generated upon detection of match with timer register TB7RG1 upon detection of
INTTBOF7: Interrupt generated up-counter overflow
Figure 3.10.27 TMRB Registers
TMP1942CY/CZ-222
TX1942CY/CZ
TMRB8 status register
7 TB8ST (0xFFFF_ F1C4) Bit symbol Read/Write After reset

6

5

4

3

2 INTTBOF8 0
1 INTTB81 R 0
0 INTTB80 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTB80: INTTB81:
Interrupt generated upon detection of match with timer register TB8RG0
Interrupt generated upon detection of match with timer register TB8RG1 INTTBOF8: Interrupt generated upon detection of up-counter overflow
TMRB9 status register
7 TB9ST (0xFFFF_ F1D4) Bit symbol Read/Write After reset

6

5

4

3

2 INTTBOF9 0
1 INTTB91 R 0
0 INTTB90 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTB90: INTTB91:
Interrupt generated upon detection of match with timer register TB9RG0 Interrupt generated upon detection of match with timer register TB9RG1 upon detection of
INTTBOF9: Interrupt generated up-counter overflow
TMRBA status register
7 TBAST (0xFFFF_ F1E4) Bit symbol Read/Write After reset

6

5

4

3

2 INTTBOFA 0
1 INTTBA1 R 0
0 INTTBA0 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTBA0: INTTBA1:
Interrupt generated upon detection of match with timer register TBARG0 Interrupt generated upon detection of match with timer register TBARG1 upon detection of
INTTBOFA: Interrupt generated up-counter overflow
Figure 3.10.28 TMRB Registers
TMP1942CY/CZ-223
TX1942CY/CZ
TMRBB status register
7 TBBST (0xFFFF_ F1F4) Bit symbol Read/Write After reset

6

5

4

3

2 INTTBOFB 0
1 INTTBB1 R 0
0 INTTBB0 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTBB0: INTTBB1:
Interrupt generated upon detection of match with timer register TBBRG0
Interrupt generated upon detection of match with timer register TBBRG1 INTTBOFB: Interrupt generated upon detection of up-counter overflow
TMRBC status register
7 TBCST (0xFFFF_ F204) Bit symbol Read/Write After reset

6

5

4

3

2 INTTBOF9 0
1 INTTB91 R 0
0 INTTB90 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTBC0: INTTBC1:
Interrupt generated upon detection of match with timer register TBCRG0 Interrupt generated upon detection of match with timer register TBCRG1 upon detection of
INTTBOFC: Interrupt generated up-counter overflow
TMRBD status register
7 TBDST (0xFFFF_ F214) Bit symbol Read/Write After reset

6

5

4

3

2
1 R
0 INTTBD0 0
INTTBOFD INTTBD1 0 0
Function
0: No 0: No 0: No interrupt interrupt interrupt generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated
INTTBD0: INTTBD1:
Interrupt generated upon detection of match with timer register TBDRG0 Interrupt generated upon detection of match with timer register TBDRG1 upon detection of
INTTBOFD: Interrupt generated up-counter overflow
Figure 3.10.29 TMRB Registers
TMP1942CY/CZ-224
TX1942CY/CZ 3.10.4 Functional description for each mode
(1) 16-bit interval timer mode To generate interrupts at certain intervals, set the interval time in the timer register TB0RG1 and enable INTTB01 interrupts.
7 TB0RUN IMC7LH TB0FFCR TB0MOD TB0RG1 TB0RUN 0 X 1 0 * * 0 6 0 X 1 0 * * 0 5 X 1 0 1 * * X 4 X 1 0 0 * * X 3 - 0 0 0 * * - 2 0 1 0 1 * * 1 1 X 0 1 * * * X 0 0 0 1 * * * 1
Stop TMRB0. Enable INTTB0 and set its priority level to 4. Disable trigger. Select prescaler output clock as input clock and disable capture function. Set interval time. (16 bits) Start TMRB0.
(** = 01, 10, 11)
Note:
X = Don't care; "-" = No change
(2) 16-bit event counter mode The timer can be used as an event counter by selecting an external clock (input to the TB0IN0 pin) as its input clock. The up-counter is incremented on each rising edge of the TB0IN0 pin input. The count value can be read by capturing it by software and reading the captured value.
7 TB0RUN PACR PAFC IMC7LH TB0FFCR TB0MOD TB0RG1 TB0RUN 0 - - X 1 0 * 0 6 0 - - X 1 0 * 0 5 X - - 1 0 1 * X 4 X 1 0 0 * X 3 - - - 0 0 0 * - 2 0 - - 1 0 1 * 1 1 X - - 0 1 0 * X 0 0 0 1 0 1 0 * 1
Stop TMRB0. Set PA0 to input mode.
Enable INTTB0 and set its priority level to 4. Disable trigger. Select TB0IN0 pin input as input clock. Set count (16 bits). Start TMRB0.
Note:
X = Don't care; "-" = No change When the timer is used as an event counter, the prescaler must be set to run (i.e. TB0RUN must be set to 1).
TMP1942CY/CZ-225
TX1942CY/CZ
(3) 16-bit PPG (programmable square wave) output mode A square wave of any frequency with any duty cycle (programmable square wave) can be output. Either Low-active or High-active output pulses can be selected. This mode is used to output a programmable square wave on the TB0OUT pin by triggering inversion of the timer flip-flop (TB0FF) when the values in the up-counter (UC0) and one of the timer registers (TB0RG0 or TB0RG1) match. However, the values set in TB0RG0 and TB0RG1 must satisfy the following condition: (TB0RG0 set value) < (TB0RG1 set value)
TB0RG0 and up-counter match (INTTB00 interrupt) TB0RG1 and up-counter match (INTTB01 interrupt) TB0OUT pin
Figure 3.10.30 Example PPG Output Waveform
If TB0RG0 has its double-buffer enabled in this mode, the value in register buffer 0 is shifted into TB0RG0 when TB0RG1 and UC0 match. Using the double-buffer facilitates satisfying the requirements for small duty cycle waveforms.
TB0RG0 and up-counter match TB0RG1 and up-counter match TB0RG0 (compare value) Register buffer Up-counter = Q1 Up-counter = Q2 Shift to TB0RG0 Q1 Q2 Q2 Q3 Write to TB0RG0
Figure 3.10.31 Register Buffer Operation
TMP1942CY/CZ-226
TX1942CY/CZ
Figure 3.10.32 shows a block diagram of 16-bit PPG output mode.
Selector
TB0IN0 T1 T4 T16
TB0RUN TB0OUT (PPB output) 16-bit up-counter UC0 Clear F/F (TB0FF0)
Match 16-bit comparator 16-bit comparator
Selector
TB0RG0
TB0RG0-WR Register buffer 0 TB0RUN TB0RG1
Internal bus
Figure 3.10.32 16-Bit PPG Output Mode Block Diagram To use the timer in 16-bit PPG output mode, set each register as shown below.
7 TB0RUN TB0RG0 TB0RG1 TB0RUN TB0FFCR TB0MOD P7CR P7FC TB0RUN 0 * * 1 X 0 - - 1
6 0 * * 0 X 0 1 1 0
5 X * * X 0 1 - - X
4 X * * X 0 0 - - X
3 - * * - 1 0 - - -
2 0 * * 0 1 1 - - 1
1 X * * X 1 * - - X
0 0 * * 0 0 * - - 1
Disable TB0RG0 double-buffer and stop TMRB0. Set duty cycle (16 bits). Set PPG cycle (16 bits). Enable TB0RG0 double-buffer. (Duty cycle and PPG cycle are changed by INTTB01 interrupt.) Set TB0FF0 so that its value will be inverted on detecting a match with TB0RG0 or TB0RG1. Also initialize TB0FF0 to 0. Select prescaler output clock as input clock and disable capture function. Set PA2 pin to TB0OUT. Start TMRB0.
(** = 01, 10, 11)
Note1: X = Don't care; "-" = No change Note2: Please do not stop a timer in PPG mode at the time of duty change (please use a double buffer). In order to change a timer-related setup, please perform the following setup, when you resume after a stop (="0") (="1"). (1) Change a timer output terminal to a PORT function. (2) Timer stop (="0") (3) Forbid a reversal output at the time of coincidence with a Up Counter and a Timer Register (TBnFFCR=00). (4) Start a timer (="1"). (5) Suspend a timer (="0"). (6) A setup of the contents of change. (7) Change an output terminal from a PORT function to a timer output. (8) Start a timer (="1").
TMP1942CY/CZ-227
TX1942CY/CZ
(4) Application examples using the capture function With its capture function enabled, TMRB can be used for various applications including those presented in the examples given below: a. One-shot pulse output using an external trigger pulse b. Frequency measurement c. Pulse width measurement
d. Time difference measurement a. One-shot pulse output using an external trigger pulse To output a one-shot pulse using an external trigger pulse, follow the procedure described below. Let the 16-bit up-counter UC0 count up in free-running mode using the prescaler output clock. Enter an external trigger pulse via the TB0IN0 pin and use the capture function to latch the up-counter value into the capture register (TB0CP0) at the rising edge of the external trigger pulse. Set INTC so that an INT3 interrupt is generated when the external trigger pulse goes High. During this interrupt write the sum of the TB0CP0 value (c) and the delay time (d) to the timer register TB0RG0. Similarly, write the sum of the TB0RG0 value and the one-shot pulse width (p), i.e. (c + d + p), to the timer register TB0RG1. Then, set the relevant field in the timer flip-flop control register (TB0FFCR ) to 11, enabling the trigger so that the timer flip-flop (TB0FF0) will be inverted on detection of a match between the value of UC0 and the value of TB0RG0 or TB0RG1. After a one-shot pulse is output, disable inversion during INTTB0 interrupt handling. The terms (c), (d) and (p) in the above explanation correspond to c, d and p in Figure 3.10., One-Shot Pulse Output (with Delay).
Counter in free-running mode Count clock (internal clock) c TB0IN0 pin input (external trigger pulse) C+d C+d+p
Latched into capture register 1 (CAP1) INT3 generated INTTB0 generated TB0RG0 and UC0 match Inversion enabled Inversion by latch into CAP1 remains disabled Delay time (d) Inversion enabled INTTB0 generated
TB0RG1 and UC0 match
TB0OUT timer output pin
Pulse width (p)
Figure 3.10.33 One-Shot Pulse Output (with Delay)
TMP1942CY/CZ-228
TX1942CY/CZ
Set-up example: To output a 2 ms one-shot pulse with a delay time of 3 ms after an external trigger pulse on the TB0IN0 pin
* Clock conditions
System clock: High-speed (fc) High-speed clock gear: x 1 (fc) Prescaler clock: fperiph/4 (fperiph = fsys) Settings in the main routine Place counter in free-running mode.
7 TB0MOD TB0FFCR X X 6 X X 5 1 0 4 0 0 3 1 0 2 0 0 1 0 1 0
Use T1 as clock source for counting.
1
Latch count into TB0CP0 on rise of TB0IN0 input.
0
Clear TB0FF0 to 0. Disable inversion of TB0FF0.
PACR PAFC IMC0HL IMC7LH TB0RUN - - X X - X X 0 - - 1 1 X - - 1 1 X - - 0 0 - 1 1 1 0 1 - - 0 0 X - - 0
Set PA2 pin to TB0OUT.
Enable INT3 and disable INTTB0
0 1
Start TMRB0.
Settings in INT3
TB0RG0 TB0RG1 TB0FFCR TB0CP0 + 3ms/T1 TB0RG0 + 2ms/T1 X X - - 1 1 - -
Enable TB0FF0 inversion when up-counter value matches TB0RG0 or TB0RG1.
IMC7LH X X 1 1 0 1 0 0
Enable INTTB0.
Settings in INTTB0
TB0FFCR X X - - 0 0 - -
Disable TB0FF0 inversion when up-counter value matches TB0RG0 or TB0RG1.
IMC7LH X X 1 1 0 0 0 0
Disable INTTB0.
Note:
X = Don't care; "-" = No change If a delay is not necessary, invert TB0FF0 by latching the counter value into TB0CP0; then, during the INT3 interrupt, write the sum of the TB0CP0 value (c) and the one-shot pulse width (p) to TB0RG1. Enable the trigger so that TB0FF0 will be inverted on detection of a match between the value of UC0 and the value of TB0RG1. TB0FF0 inversion should be disabled during INTTB0 interrupt handling.
TMP1942CY/CZ-229
TX1942CY/CZ
Count clock (prescaler output clock) TB0IN0 pin input (external trigger pulse) c C+p Latched into capture register TB0CP0 INT5 generated INTTB01 generated TB0RG1 and UC0 match Inversion enabled TB0OUT timer output pin Inversion by latch into TB0CP0 remains enabled Pulse width (p) TB0FF0 left disabled so that it will not be inverted by latch into TB0CP1 Latched into capture register TB0CP1
Figure 3.10.34 One-Shot Pulse Output Using an External Trigger Pulse (without Delay)
b. Frequency measurement With its capture function enabled, the timer can be used to measure the frequency of an external clock. The frequency is measured using a combination of a 16-bit timer/event counter and 8-bit timers (TMRA01). (TMRA01 determines the measurement time by inverting TA1FF.) Select TB0IN0 pin input as the count clock for TMRB0 so that it counts up synchronously with the external clock pulses. Set TB0MOD to 11. This setting causes the count value of the 16-bit up-counter UC0 to be latched into the capture register TB0CP0 when the 8-bit timer (TMRA01) flip-flop (TA1FF) output goes High, and to be latched into the capture register TB0CP1 when the TA1FF output goes Low. The frequency is calculated from the difference between the loaded values in TB0CP0 and TB0CP1 based on the measurement time determined by an 8-bit timer interrupt INTTA0 or INTTA1.
Count clock (TB0IN0 pin input) C1 TA1OUT Latched into TB0CP0 Latched into TB0CP1 INTTA0/INTTA1 C1 C2 C1 C2 C2
Figure 3.10.35 Frequency Measurement
For example, if the 8-bit timers set the High level width of TA1FF to 0.5 s and the difference between TB0CP0 and TB0CP1 is 100, then the frequency is 100/0.5 s = 200 Hz.
TMP1942CY/CZ-230
TX1942CY/CZ
c. Pulse width measurement With its capture function enabled, the timer can be used to measure the high-level duration of an external pulse. Enter an external pulse via the TB0IN0 pin and let the up-counter (UC0) count up in free-running mode using the prescaler output clock. Then, using the capture function, latch the up-counter value into the capture registers TB0CP0 and TB0CP1 on the rising and falling edges of the external pulse, respectively. Set INTC so that INT5 is generated when the TB0IN0 pin goes Low. The High-level duration of the pulse can be obtained by finding the difference between TB0CP0 and TB0CP1 and multiplying the resulting value by the internal clock period. For example, if the difference between TB0CP0 and TB0CP1 is 100 and the prescaler output clock period is 0.5 s, then the pulse width will be 100 x 0.5 s = 50 s. Additionally, the pulse width which exceeds the UC0 maximum count time specified by the clock source can be measured by software coding.
Prescaler output clock TB0IN0 pin input (external pulse) Latched into TB0CP0 Latched into TB0CP1 INT5 C1 C2
C1 C2
C1 C2
Figure 3.10.36 Pulse Width Measurement
The Low-level duration can be measured using the time difference measurement function shown in Figure 3.10.. The Low-level duration is obtained by multiplying the difference between the first C2 and the second C1 by the prescaler output clock period during the handling of the second INT5 interrupt.
TMP1942CY/CZ-231
TX1942CY/CZ
d. Time difference measurement With its capture function enabled, the timer can be used to measure the difference in time between two events. Let the up-counter (UC0) count up in free-running mode using the prescaler output clock. Latch the UC0 value into the capture register TB0CP0 at the rising edge of the pulse input on the TB0IN0 pin. Set INTC so that an INT3 interrupt is generated at that point. Latch the UC0 value into the capture register (TB0CP1) at the rising edge of the pulse input on the TB0IN1 pin. Set INTC so that an INT4 interrupt is generated at that point. The difference in time can be obtained by subtracting the value in TB0CP0 from the value in TB0CP1 after the values have been latched into the capture registers, and then multiplying the difference by the internal clock period.
Prescaler output clock C1 TB0IN0 pin input C2
TB0IN1 pin input Latched into TB0CP0 Latched into TB0CP1 INT3
INT4 Time difference
Figure 3.10.37 Time Difference Measurement
TMP1942CY/CZ-232
TX1942CY/CZ
(5) 2-phase pulse input counter mode (TMRB2 and TMRB3) (The function operates in the same way for TMRB2 and TMRB3. Only TMRB2 is described here.) In this mode, the counter is either incremented or decremented by one according to the state transition of 2-phase clock pulses, with a phase difference of 90 degrees, input from TB2IN0 and TB2IN1. An interrupt is generated when the up/down-counter overflows or underflows, or when it is incremented or decremented. a. Count operation * Counting up
Counter value n n+1
TB0IN0
0
1
TB0IN1
1
1
Counter value + 1
Figure 3.10.38 Counting Up * Counting down
Counter value n n-1
TB0IN0
1
1
TB0IN1
0
0
Counter value - 1
Figure 3.10.39 Counting Down * Sampling clock TMRB2 run register (TB2RUN)
7 Bit symbol Read/Write After reset TB2RDE R/W 0
Double Buffer
6

5 UD2CK R/W 0
Sampling clock selection 0: fs 1: fsys/2
4 TB2UDCE R/W 0
3 I2TB2 R/W 0
2 TB2PRUN R/W 0
1

0 TB2RUN R/W 0
Function
0: Disable 1: Enable
Timer Run/Stop Control 2-phase IDLE counter enable 0: Idle 0: Stop and cleared 0: Disable 1: Operate 1: Count 1: Enable
Figure 3.10.40 Register for Setting 2-Phase Pulse Input Counter Mode
TMP1942CY/CZ-233
TX1942CY/CZ
Bit 5 of the TB2RUN register (UD2CK) determines the sampling clock to be used. UD2CK (sampling clock selection) = 0: Selects fs (32 kHz) (8 kHz sampling) 1: Selects fsys/2 (fsys/8 Hz sampling) 1) Exiting from STOP mode Because an 2-phase timer interrupt cannot be used to terminate STOP mode, an interrupt on the INTB or INTC shared pin is used to terminate STOP mode.
TMRB INTTB2
INTC
INTBCDE
CG
Terminate STOP/SLEEP mode using this path.
The 2-phase counter enters STOP mode while retaining its previous state. Therefore, if the relationship between the state of the input used to terminate STOP mode and the retained state satisfies the condition for counting up or down, the counter value is incremented or decremented after STOP mode has been terminated. (The counter value remains unchanged if the condition is not satisfied.) If it is necessary to obtain a constant counter state after exiting from STOP mode, initialize the 2-phase counter after STOP mode is terminated (clearing TB2RUN to 0 and then setting it to 1 initializes the counter to 0x7FFF). 2) Exiting from SLEEP mode Because an 2-phase timer interrupt cannot be used to terminate SLEEP mode, an interrupt on the INTBCDE shared pin is used to terminate SLEEP mode. Whether the 2-phase counter is incremented or decremented depends on the state of the input used to terminate SLEEP mode. If it is necessary to obtain a constant counter state after exiting from SLEEP mode, initialize the 2-phase counter after SLEEP mode is terminated (clearing TB2RUN to 0 and then setting it to 1 initializes the counter to 0x7FFF). b. Operating mode Use appropriate register bits to determine whether the external input signals on the TB2IN0 and TB2IN1 input pins will be sent to the ordinary 16-bit timer or to the up/down-counter. * In up/down-counter mode, only software capture is available; capture based on external clock timing is not enabled. In up/down-counter mode, the comparator is disabled; comparison with timer registers is not performed.
*
TMP1942CY/CZ-234
TX1942CY/CZ
* In up/down-counter mode, ordinary INTB to INTE interrupts (interrupts other than those used to terminate STOP/SLEEP mode) cannot be used. The input clock signals are sampled at fs (32 kHz) or based on the high-speed clock (system clock). When fs is used, the maximum input frequency is 8 kHz. When the high-speed clock is used, the maximum input frequency is fsys/8 Hz.
*
Setting the up/down-counter Set TB2MOD to "00" (prescaler disabled). Next, set bit 4 of the TB2RUN register (TB2UDCE) to determine whether the counter should operate as a up/down counter or as an ordinary up-counter based on external clock input. TB2UDCE (up/down-counter enable) = 0: Normal 16-bit timer operation 1: Up/down-counter operation TMRB2 run register (TB2RUN)
7 Bit symbol Read/Write After reset TB2RDE R/W 0 Double Buffer 0: Disable 1: Enable 6

5 UD2CK R/W 0 Sampling clock selection 0: fs 1: fsys/2
4 TB2UDCE R/W 0 2-phase counter enable 0: Disable 1: Enable
3 I2TB2 R/W 0
2 TB2PRUN R/W 0
1

0 TB2RUN R/W 0
Function
IDLE Timer Run/Stop Control 0: Idle 0: Stop and cleared 1: Operate 1: Count
Figure 3.10.41 Register for Setting the Up/Down-Counter
c. *
Interrupts In NORMAL or SLOW mode Enable INTTB2 interrupts in the interrupt controller (INTC). An INTTB2 interrupt will occur when the counter either counts up or down. You can determine whether an overflow or underflow has occurred at the same time by reading the status register TB2ST during the handling of the interrupt. An overflow has occurred if TB2ST = 1. An underflow has occurred if TB2ST = 1. This register is cleared when read. An overflow causes the counter to be initialized to 0x0000 and an underflow causes the counter to be initialized to 0xFFFF, allowing the counter to continue counting.
7 6

5

4
INTTBUD2
3 R
2
1

0

TB2ST (0xFFFF_ F164)
Bit symbol Read/Write After reset

INTTBUDF2 INTTBOUF2
0
Up or down count
0
Underflow 0: Not detected 1: Detected
0
Overflow 0: Not detected 1: Detected
Function
0: Not detected 1: Detected
Figure 3.10.42 TMRB2 Status Register
TMP1942CY/CZ-235
TX1942CY/CZ
* In SLEEP mode The 2-phase pulse input counter operates. Enable the INTBCDE release input in the clock generator (CG). Use INTnST of the INTBCDE circuit to set the active level for each interrupt input. An up or down counter input generates an INTB or INTC interrupt, causing the counter to exit from SLEEP mode. The interrupt source is determined by reading the flag register INTFLG. The flag is cleared when read. Whether this releasing interrupt source causes the counter to count up or down depends on whether the state of the releasing input satisfies the condition for counting up or down.
7 INTFLG (0xFFFF_ F384) Bit symbol Read/Write After reset

6

5

4

3 INTES 0
2 INTDS R 0
1 INTCS 0
0 INTBS 0
Function
0: No 0: No 0: No 0: No interrupt interrupt interrupt interrupt generated generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated generated
Figure 3.10.43 INTFLG Register * In STOP mode The 2-phase pulse input counter stops. Enable the INTBCDE release input in the clock generator (CG). An up or down counter input generates an INTB or INTC interrupt, causing the counter to exit from STOP mode. Whether this releasing input causes the counter to count up or down depends on the relationship between the input state prior to entering STOP mode and the state of the releasing input. After the releasing input is asserted, the device warms up for the specified period before entering NORMAL or SLOW mode to restart counting. d. Up/down-counter When 2-phase input counter mode is selected (TB2RUN = 1), the up-counter is initialized to 0x7FFF and operates as an up/down-counter. If the counter overflows, it is initialized to 0x0000 and continues counting. If the counter underflows, it is initialized to 0xFFFF and continues counting. Therefore, you can determine the state of the counter by reading the counter value and the status flag TB2ST after an interrupt occurs.
Sampling clock
Count up input
Up/down-counter value
0x3FFF
0x4000
0x4001
Up/down interrupt
Note 1: Ensure that the count up (down) input is High before and after it is input. Note 2: The counter value must be read during exception handling for INTTB2. If the counter value is read during exception handling for INTB or INTC used to terminate SLEEP or STOP mode, the counter value varies depending on whether the condition is satisfied or not and the difference in time between SLEEP/STOP mode being terminated and counting being restarted.
TMP1942CY/CZ-236
TMP1942CY/CZ
3.11 Serial Channels (SIO)
The TMP1942 contains five serial input/output channels: SIO0, SIO1, SIO3, SIO4 and SIO5. Each channel can be operated in (asynchronous) UART mode or (synchronous) I/O interface mode, as shown below. * I/O interface mode Mode 0: Transmit and receive I/O data using the sync signal (SCLK) for extended I/O operation. Mode 1: Transmit and receive 7-bit data. Mode 2: Transmit and receive 8-bit data. Mode 3: Transmit and receive 9-bit data.
*
Asynchronous (UART) mode
In modes 1 and 2 a parity bit can be added. Mode 3 supports a wake-up function which is used by the master controller in a multi-controller system to initiate communication with a slave controller via a serial link. Figure 3.11.2 shows a block diagram for SIO0. Each channel consists of a prescaler, a serial clock generator, a receive buffer and its accompanying control circuit, and a transmit buffer and its accompanying control circuit. All channels operate independently of each other. Because all channels operate in the same way, this section consists only of an explanation for SIO0.
* Mode 0 (I/O interface mode): LSB first bit 0 1 2 3 4 5 6 7
Direction of transfer * Mode 0 (I/O interface mode): MSB first bit 7 6 5 4 3 2 1 0
Direction of transfer * Mode 1 (7-bit UART mode) Without parity start bit 0 1 2 3 4 5 6 stop
With parity
start
bit 0
1
2
3
4
5
6
parity stop
* Mode 2 (8-bit UART mode) Without parity start bit 0 1 2 3 4 5 6 7 stop
With parity
start
bit 0
1
2
3
4
5
6
7
parity stop
* Mode 3 (9-bit UART mode) start bit 0 1 2 3 4 5 6 7 8 stop
start
bit 0
1
2
3
4
5
6
7
bit 8
Stop (wake-up)
Address (selection code) when bit 8 = 1 Data when bit 8 = 0
Figure 3.11.1 Data Formats
TMP1942CY/CZ-237
TMP1942CY/CZ 3.11.1 Block diagram (for channel 0 as an example)
Prescaler T0 2 4 8 16 32 64
T2 T8 T32 Serial Clock Generator BR0CR BR0CR T0 T2 T8 T32 Selector Divider BR0ADD
TA6TRG (from TMRA0)
Selector
Selector
UART mode
SIOCLK
BR0CR Baud Rate Generator fSYS/2 /2 SCLK0 Input (shared with PD2)
SC0MOD0 SC0MOD0 Selector SC0CR
I/O interface mode
SCLK0 Output (shared with PD2)
I/O Interface Mode
Receive Counter (divided by 16 for UART only) RXDCLK SC0MOD0 Receive Controller
SC0MOD0 Serial Channel Interrupt Control
Transmit counter (divided by 16 for UART only) TXDCLK Transmission Controller
Interrupt Request INTRX0 Interrupt Request INTTX0
CTS0
SC0CR Parity Controller RXD0 (shared with PD1) Receive Buffer 1 (shift register)
(shared with PD2) SC0MOD0
Transmit Buffer 1 (shift register)
TXD0 (shared with PD0)
RB8 Receive Buffer 2 (SC0BUF)
Error flag
TB8 Transmit Buffer 2 (SC0BUF)
SC0CR Internal Data Bus Internal Data Bus Internal Data Bus
Figure 3.11.2 SIO0 Block Diagram
TMP1942CY/CZ-238
TMP1942CY/CZ 3.11.2 Functional description of each circuit (for channel 0 as an example)
(1) Prescaler The TMP1942 has a 6-bit prescaler to supply an operating clock to SIO0. The prescaler's input clock T0 has a frequency of fperiph, fperiph/2 or fperiph/4 as selected by SYSCR0 in the CG block. fperiph is either the clock fgear as selected by SYSCR1 in the CG block or the clock fc before division by the clock gear. The prescaler operates only when the baud rate generator has been specified as the serial transfer clock. Table 3.11.1 shows the resolutions of the prescaler output clocks. Table 3.11.1 Baud Rate Generator Input Clock Resolutions
@ = 32 MHz
Peripheral Clock Gear Selected Clock Selection Value Prescaler Clock
00 (fperiph/4) 00 (fc) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fc/2) 0 (fgear) 10 (fc/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 11 (fc/8) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 00 (fc) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fc/2) 1 (fc) 10 (fc/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 11 (fc/8) 01 (fperiph/2) 10 (fperiph)
2 3 2
Prescaler Output Clock Resolution
T0
fc/2 (0.125 s) fc/2 (0.25 s) fc/2 (0.5 s)
4 3
T2
fc/2 (0.5 s)
4
T8
fc/2 (2.0 s)
6 5 4 7 6 5 8 7 6
T32
fc/2 (8.0 s)
8 7 6
fc/2 (0.25 s) fc/2 (0.125 s)
2
fc/2 (1.0 s) fc/2 (0.5 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (8.0 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (16 s)
9
fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (16 s)
9
fc/2 (1.0 s)
5 4
fc/2 (0.5 s) fc/2 (0.25 s)
3
fc/2 (8.0 s)
8 7
fc/2 (4.0 s) fc/2 (32 s)
10 9
fc/2 (2.0 s)
6 5 4 7 6 5 4
fc/2 (1.0 s)
5
fc/2 (1.0 s) fc/2 (0.5 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (0.5 s) fc/2 (0.25 s)
3
fc/2 (16 s) fc/2 (8.0 s)
8
fc/2 (64 s)
11 10 9
fc/2 (0.125 s)
fc/2 (8.0 s)
8 7 6 5 4 6 5 4 6 5 4 6 5
fc/2 (32 s) fc/2 (16 s) fc/2 (8.0 s)
8 7 6 8 7 6 8 7 6 8 7 6
fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (0.5 s) fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (0.5 s) fc/2 (2.0 s) fc/2 (1.0 s) fc/2 (0.5 s) fc/2 (2.0 s) fc/2 (1.0 s)
fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (8.0 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (8.0 s) fc/2 (4.0 s) fc/2 (2.0 s) fc/2 (8.0 s) fc/2 (4.0 s) fc/2 (2.0 s)
fc/2 (0.125 s)
2
fc/2 (0.5 s)
4
fc/2 (0.25 s)
3
fc/2 (0.5 s)
4

Note 1: The prescaler's output clock Tn must be selected such that the relationship Tn < fsys/2 is satisfied (i.e., Tn must be slower than fsys/2). Note 2: Do not change the clock gear value while the timer is running Note 3: The -- character means "Don't use" One of prescaler output clocks - T0, T2, T8 or T32 - is used for the serial interface baud rate generator.
TMP1942CY/CZ-239
TMP1942CY/CZ
(2) Baud rate The baud rate generator is used to generate the transmit/receive clock which determines the rate at which data is transferred via serial channels. The clock source fed to the baud rate generator is the clock T0, T2, T8 or T32 as output by the 6-bit prescaler. This input clock is selected by setting the bits BR0CR in the baud rate generator control register. The baud rate generator contains a divider which can divide the input clock frequency by 1, n + m (n = 2-15, m = 0-15) or 16. The input clock frequency is divided according to the values set in 16 BR0CR and BR0ADD to specify the rate of transfer. * 1) For UART mode When BR0CR = 0 The value set in BR0ADD is ignored and the input clock is divided by the value N set in BR0CR (N = 1, 2, 3... 16). 2) When BR0CR = 1 The input clock is divided by N+(16-K)/16, where the value of N is specified by BR0CR (N = 2, 3... 15) and the value of K is specified by BR0ADD (K = 1, 2, 3... 15). Note: When N = 1 or 16, division by N+(16-K)/16 is disabled. In that case, always set BR0CR to 0. * For I/O interface mode
Division by N+(16-K)/16 cannot be used in I/O interface mode. In this mode always set BR0CR to 0 so that the input clock will be divided by N. The baud rate is calculated as follows: * In UART mode Baud rate =
Baud rate generator input clock / 16 Baud rate generator divisor
The maximum baud rate which can be generated by the baud rate generator is 500 kbps and is generated when T0 = 8 MHz. In addition to an output from the baud rate generator, fsys/2 can also be used as a serial clock. If fsys/2 is used as a serial clock, the maximum baud rate is 1 Mbps, which is generated when fsys = 32 MHz. * In I/O interface mode Baud rate =
Baud rate generator input clock /2 Baud rate generator divisor
TMP1942CY/CZ-240
TMP1942CY/CZ
* When dividing the input clock by an integer (N) If T2 is chosen as the input clock to the baud rate generator with the divisor N (BR0CR) set to 10 and BR0CR set to 0 after fc = 24.576 MHz has been specified as fperiph and T0 has been set to fperiph/4, then the baud rate in UART mode is calculated as follows:
* Clock conditions System clock Prescaler clock : High-speed (fc) : fperiph/4 (fperiph = fsys)
High-speed clock gear : x 1 (fc)
Baud rate =
fc /16 / 16 10
= 24.576 x 106 / 16 / 10 / 16 = 9600 (bps)
Note: Since division by N+(16-K)/16 is disabled, the value set in BR0ADD is ignored. * When dividing the input clock by N+(16-K)/16 (UART mode only)
If T2 is chosen as the input clock to the baud rate generator with the divisor N (BR0CR) set to 7, K (BR0ADD) set to 3 and BR0CR set to 1 after fc = 19.2 MHz has been specified as fperiph and T0 has been set to fperiph/4, the baud rate is calculated as follows:
* Clock conditions System clock Prescaler clock : High-speed (fc) : fperiph/4 (fperiph = fsys)
High-speed clock gear : x 1 (fc)
Baud rate =
fc /16 / 16 16 - 3 7+ 16 13 ) / 16 = 9600 (bps) 16
= 19.2 x 106 / 16 / (7 +
Tables 3.11.2 and 3.11.3 show example baud rates in UART mode. Instead of a prescaler output, a clock input from an external source can also be used as the serial clock. In this case the baud rate is calculated as follows: * UART mode Baud rate = external clock input/16 However, the period of the external clock must be greater than or equal to 4/fsys. * I/O interface mode Baud Rate = external clock input However, the period of the external clock must be greater than or equal to 16/fsys.
TMP1942CY/CZ-241
TMP1942CY/CZ
Table 3.11.2 UART Baud Rate Selection (When the baud rate generator is used and BR0CR = 0)
Units: kbps
fc [MHz]
19.6608 24.576 29.4912
Divisor N (Specified with BR0CR)
1 2 4 8 0 5 A 1 2 3 4 6 C
Input Clock T0 (fc/4)
307.200 153.600 76.800 38.400 19.200 76.800 38.400 460.800 230.400 153.600 115.200 76.800 38.400
T2 (fc/16)
76.800 38.400 19.200 9.600 4.800 19.200 9.600 115.200 57.600 38.400 28.800 19.200 9.600
T8 (fc/64)
19.200 9.600 4.800 2.400 1.200 4.800 2.400 28.800 14.400 9.600 7.200 4.800 2.400
T32 (fc/256)
4.800 2.400 1.200 0.600 0.300 1.200 0.600 7.200 3.600 2.400 1.800 1.200 0.600
Note: The values shown in the table above are applied when the system clock frequency = fc, the clock gear = fc/1 and the prescaler clock frequency = fperiph/4. Table 3.11.3 UART Baud Rate Selection (When TMRA6 timer trigger output is used and TMRA6 input clock = T1)
Units: kbps
TA0REG
1H 2H 3H 4H 5H 6H 8H AH 10H 14H
fc 29.4912 MHz 24.576 MHz
230.4 115.2 76.8 57.6 46.08 38.4 28.8 23.04 14.4 11.52 192 96 64 48 38.4 32 24 19.2 12 9.6
24 MHz
187.5 93.75 62.5 46.88 37.5 31.25 23.44 18.75 11.72 9.38
19.6608 MHz
153.6 76.8 51.2 38.4 30.72 25.6 19.2 15.36 9.6 7.68
16 MHz
125 62.5 41.67 31.25 25 20.83 15.63 12.5 7.81 6.25
12.288 MHz
96 48 32 24 19.2 16 12 9.6 6 4.8
Calculate the baud rate as follows (when timer TMRA6 is used):
Clock frequency specified with SYSCR0 < PRCK1: PRCK0 > TA0REG x 2 x16
Transfer rate =
(when TMRA6 input clock = T1) Note 1: The trigger signal from timer TMRA6 cannot be used as the transfer clock in I/O interface mode. Note 2: The values shown in the table above are applied when the system clock frequency = fc, the clock gear = fc/1, and the prescaler clock frequency = fperiph/4.
TMP1942CY/CZ-242
TMP1942CY/CZ
(3) Serial clock generator This circuit generates a basic clock used to transmit and receive data. * For I/O interface mode In SCLK output mode (when SC0CR = 0), the basic clock is generated by dividing the baud rate generator output, described above, by 2. In SCLK input mode (when SC0CR = 1), the basic clock is generated by detecting either the rising or falling edges of the SCLK input, as specified by the SC0CR setting. * For asynchronous (UART) mode One of the following four sources is selected to generate the basic clock SIOCLK: the clock output by the baud rate generator as described above, the system clock (fsys/2), the trigger output signal from timer TMRA6, or the external clock (on the SCLK0 pin). The setting of SC0MOD0 specifies which source is selected. (4) Receive counter The receive counter is a 4-bit binary counter which is used in asynchronous (UART) mode. This counter is incremented every time a SIOCLK pulse is detected. Receiving one bit of data requires 16 SIOCLK pulses and data is sampled three times: at the seventh, eighth and ninth pulses. The received data is determined from the three samples by majority rule. (5) Receive controller * For I/O interface mode In SCLK output mode (when SC0CR = 0), the RXD0 pin is sampled at the rising edge of the shift clock which is output to the SCLK0 pin. In SCLK input mode (when SC0CR = 1), the RXD0 pin is sampled at either the rising or falling edge of the SCLK input, as specified by the setting of SC0CR. * For asynchronous (UART) mode The receive controller incorporates a start bit detection circuit so that it can start receive operation upon the detection of a valid start bit.
TMP1942CY/CZ-243
TMP1942CY/CZ
(6) Receive buffer The receive buffer has double-buffer structure to prevent overrun errors. Received data is stored one bit at a time in receive buffer 1 (a shift register). When all bits of data have been received, the data is transferred to another receive buffer, receive buffer 2 (SC0BUF), at which point an INTRX0 interrupt is generated. Also, the receive buffer full flag (SC0MOD2) is set to 1 simultaneously, indicating that receive buffer 2 contains valid data. The CPU reads data from receive buffer 2 (SC0BUF). This read causes the RBFLL flag to be cleared to 0. Next received data can be stored in receive buffer 1 even before the CPU reads the data out from receive buffer 2 (SC0BUF). When SCLK output is selected in I/O interface mode, receive buffer 2 (SCOBUF) can be enabled or disabled by setting SC0MOD2 accordingly. Disabling receive buffer 2 allows the device to handshake with the remote device it is communicating with, so that it stops CLK output every time it has sent a single frame. In that case, the CPU reads data from receive buffer 1. This read causes CLK output to restart. When receive buffer 2 is enabled in I/O interface mode, operation is as follows: The first received data is transferred from receive buffer 1 to receive buffer 2. CLK output stops when the next data has been received and both receive buffers 1 and 2 contain valid data. Once the CPU has read data from receive buffer 2, the data in receive buffer 1 is transferred to receive buffer 2, at which point an INTRX0 interrupt is generated and CLK output is restarted. Therefore, no overrun error occurs in SCLK output I/O interface mode, regardless of the WBUG setting. Note: In this mode the SC0CR OEER flag has no meaning, resulting in undefined operation. Be sure to read SC0CR to initialize this flag before changing the mode from SCLK output mode. In other operating modes, receive buffer 2 is always enabled to improve performance for continuous transfer. However, if the CPU has not read the data out from receive buffer 2 (SC0BUF) by the time all the bits of the next data item have been received into receive buffer 1, an overrun error will occur. If an overrun error occurs, the contents of receive buffer 1 will be lost; the contents of receive buffer 2 and SC0CR will be retained. SC0CR stores either the parity bit which is added to 8-bit UART data or the most significant bit of 9-bit UART data. In 9-bit UART mode, slave controller wake-up operation can be enabled by setting SC0MOD0 to 1. In this case, an INTRX0 interrupt is only generated if SC0CR = 1. (7) Transmit counter The transmit counter is a 4-bit binary counter used in asynchronous (UART) mode. Like the receive counter, this counter is incremented every time a SIOCLK pulse is detected and generates a transmit clock (TXDCLK) pulse every 16 SIOCLK pulses.
SIOCLK 15 TXDCLK 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2
Figure 3.11.3 Generating a Transmit Clock
TMP1942CY/CZ-244
TMP1942CY/CZ
(8) Transmit controller * In I/O interface mode In SCLK output mode (when SC0CR = 0), data is output from the transmit buffer to the TXD0 pin one bit at a time at each rising edge of the shift clock output on the SCLK0 pin. In SCLK input mode (when SC0CR = 1), data is output from the transmit buffer to the TXD0 pin one bit at a time, either at each rising edge or each falling edge of the SCLK input as specified by the setting of SC0CR. * In asynchronous (UART) mode After transmit data has been written to the transmit buffer by the CPU, the transmit controller will start transmitting the data at the next rising edge of TXDCLK, thus generating a transmit shift clock (TXDSFT). Handshaking function The device has a CTS pin, which makes it possible to transmit data in frame units, preventing overrun errors from occurring. This function can be enabled or disabled using SC0MOD. When the CTS0 pin goes High, the transmitter stops transmission after it has finished sending the current data and remains idle until the CTS0 pin goes back to Low. The transmit controller generates an INTTX0 interrupt to request the next transmission of data from the CPU and, after writing the data to the transmit buffer, will wait for the new data to be sent. Although the device does not have an RTS pin, the handshaking function can be implemented in the following way: One of the receiver's ports can be assigned to the function and when the receiver has finished receiving data, it drives that port High (using the receive interrupt routine), thereby requesting the transmitter to temporarily suspend transmission.
TMP1942 TMP1942
TXD CTS Transmitter
RXD
RTS (any port) Receiver
Figure 3.11.4 Handshaking Function
Timing at which data is written to the transmit buffer or shift register CTS
Note 2 No transmission takes place during this period. Note 1 13 14 15 16 1 2 3 14 15 16 1 2 3
SIOCLK
TXDCLK
TXD
start bit
bit 0
Note 1: Note 2:
When CTS goes High during transmission, the transmitter will stop sending data upon the completion of transmitting the current data item. The transmitter starts sending data at the first falling edge of the TXDCLK clock after the CTS signal has been pulled Low. Figure 3.11.5 Clear to Send ( CTS ) Signal Timing
TMP1942CY/CZ-245
TMP1942CY/CZ
(9) Transmit buffer The transmit buffer (SC0BUF) has double-buffer structure. The double-buffer can be enabled or disabled by setting SC0MOD1 accordingly. When the double-buffer is enabled, data written to transmit buffer 2 (SC0BUF) is transferred to transmit buffer 1 (a shift register), at which point an INTTX interrupt is generated. Also, the SCnMOD2 TBEMP flag is set to 1 simultaneously, indicating that transmit buffer 2 is empty so that next transmit data can be written. The TBEMP flag is cleared to 0 when next transmit data is written to transmit buffer 2. When the double-buffer is disabled, the CPU writes transmit data to transmit buffer 1 and an INTTX interrupt occurs upon the completion of transmission.
Note: In this mode the SC0CR UEER flag has no meaning, resulting in undefined operation. Be sure to read SC0CR to initialize this flag before changing the mode from SCLK output mode. If it is necessary to handshake with the remote device, set WBUF to 0 to disable transmit buffer 2. To perform continuous transmission without handshaking, you can improve performance by setting WBUF to 1 to enable transmit buffer 2. (10) Parity controller Data transmission with parity is enabled by setting the PE bit of the serial channel control register SC0CR to 1. Note, however, that parity can only be used in 7-bit UART mode or 8-bit UART mode. The SC0CR bit can be used to select even or odd parity. During transmission the parity controller automatically generates parity bits from the data written to the transmit buffer (SC0BUF). Upon the completion of transmitting the data, it stores the parity in SC0BUF in 7-bit UART mode or SC0MOD0 in 8-bit UART mode. The PE and EVEN bits in the SC0CR register must be set before the transmit data is written to the transmit buffer. During reception the parity controller automatically generates parity bits from the data which has been shifted in and transferred from receive buffer 1 to receive buffer 2 (SC0BUF), and compares it with the parity stored in SC0BUF in 7-bit UART mode or SC0CR in 8-bit UART mode. If the parities do not match, a parity error is generated, setting the SC0CR flag. In I/O interface mode, SC0CR is not a parity flag but functions as an underrun error flag.
TMP1942CY/CZ-246
TMP1942CY/CZ
(11) Error flags Three error flags are available for the purpose of increasing the reliability of the received data. 1. Overrun error In both UART and I/O interface modes, an overrun error occurs when all bits of the next frame have been received before data stored in the receive buffer is read out completely. An overrun error causes the OERR flag to be set. Reading the flag clears it to 0. If SCLK output is selected in I/O interface mode, however, this flag is undefined because no overrun error will occur. 2. Parity error/underrun error In UART mode, the PERR flag is set to 1 when a parity error occurs. A parity error occurs if the parity calculated from the received data differs from the received parity bit. Reading the PERR flag clears it to 0. In I/O interface mode, the PERR bit indicates an underrun error. When SC0MOD2 is set to 1, an underrun error occurs in the following case: In SCLK input mode, it occurs if data stored in the transmit shift register has been transmitted but no data is set in the transmit double-buffer before the next transfer clock is input. In SCLK output mode, this flag is undefined because no underrun error will occur. The PERR flag is not set when transmit buffer 2 is disabled. Reading the flag clears it to 0. 3. Framing error In UART mode, the FERR flag is set to 1 when a framing error occurs. Reading the flag clears it to 0. A framing error occurs if the stop bit in the received data is detected as being 0 when sampled around the center. Operating Mode
UART
Error Flag
OERR PERR FERR Overrun error flag Parity error flag Framing error flag Overrun error flag
Description
I/O interface (SCLK input)
OERR PERR FERR
Underrun error flag (WBUF = 1) Fixed to 0 (WBUF = 0) Fixed to 0 Undefined Undefined Fixed to 0
I/O interface (SCLK output)
OERR PERR FERR
Note:FERR reading occurs during the interruption handling must be executed before a receive buffer reading. Polling for reading FERR is prohibited. See the example in 3.11.4 (3) Mode 2 (8-bit UART Mode) for the details.
(12) Direction of data transfer In I/O interface mode, the direction of transfer can be toggled between MSB first and LSB first by setting SCnMOD2. Do not change the direction of transfer while data is being transferred.
TMP1942CY/CZ-247
TMP1942CY/CZ
(13) STOP bit length In UART mode, the STOP bit length in transmit data can be toggled between one bit and two bits by setting SCnMOD2. (14) Status flag The SCnMOD2 bit is a flag which indicates that the receive buffer is full when the double-buffer is enabled (WBUF = 1). Once a single frame of data has been received and the data has been transferred from receive buffer 1 to receive buffer 2, this flag is set to 1, indicating that buffer 2 is full (contains data). When the CPU/DMAC reads the receive buffer, the flag is cleared to 0. When WBUF = 0, the RBFLL bit has no meaning and cannot be used as a status flag. TBEMP is a flag which indicates that transmit buffer 2 is empty when the double-buffer is enabled (WBUF = 1). Once data has been transferred from transmit buffer 2 to transmit buffer 1 (a shift register), this flag is set to 1, indicating that transmit buffer 2 is empty. When the CPU/DMAC writes data to the transmit buffer, the flag is cleared to 0. When WBUF = 0, the TBEMP bit has no meaning and cannot be used as a status flag. (15) Transmit/receiver buffer configuration WBUF = 0
UART I/O interface (SCLK input) I/O interface (SCLK output) Transmit Receive Transmit Receive Transmit Receive SINGLE DOUBLE SINGLE DOUBLE SINGLE SINGLE
WBUF = 1
DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE
(16) Signal generation timing 1) UART mode Reception Mode 9 bits
Interrupt generation timing Framing error generation timing Parity error generation timing Overrun error generation timing Center of first stop bit Center of stop bit
8 bits + parity
Center of first stop bit Center of stop bit Center of last bit (parity bit) Center of stop bit
8 bits, 7 bits + parity, or 7 bits
Center of first stop bit Center of stop bit Center of last bit (parity bit) Center of stop bit
Center of stop bit
Transmission Mode 9 bits
Interrupt generation timing (WBUF = 0) Interrupt generation timing (WBUF = 1) Immediately before stop bit is sent Immediately after data is transferred to transmit buffer 1 (immediately before start bit is sent)
8 bits + parity
Immediately before stop bit is sent Immediately after data is transferred to transmit buffer 1 (immediately before start bit is sent)
8 bits, 7 bits + parity, or 7 bits
Immediately before stop bit is sent Immediately after data is transferred to transmit buffer 1 (immediately before start bit is sent)
TMP1942CY/CZ-248
TMP1942CY/CZ
2) I/O interface mode Reception
Interrupt generation timing (WBUF = 0) Interrupt generation timing (WBUF = 1) SCLK output mode SCLK input mode SCLK output mode Immediately after rise of last SCLK pulse Immediately after rise of last SCLK pulse (rise mode); in fall mode, immediately after fall of last SCLK pulse Immediately after rise of last SCLK pulse (immediately after data is transferred to receive buffer 2) or immediately after data is read from receive buffer 2 Immediately after rise of last SCLK pulse (rise mode); in fall mode, immediately after fall of last SCLK pulse (immediately after data is transferred to receive buffer 2) Immediately after rise of last SCLK pulse Immediately after rise of last SCLK pulse (rise mode); in fall mode, immediately after fall of last SCLK pulse
SCLK input mode
Overrun error generation timing
SCLK output mode SCLK input mode
Transmission
Interrupt generation timing (WBUF = 0) Interrupt generation timing (WBUF = 1) SCLK output mode SCLK input mode SCLK output mode SCLK input mode Immediately after rise of last SCLK pulse Immediately after rise of last SCLK pulse (rise mode); in fall mode, immediately after fall of last SCLK pulse Immediately after rise of last SCLK pulse or immediately after data is transferred to transmit buffer 1 Immediately after rise of last SCLK pulse (rise mode); in fall mode, immediately after fall of last SCLK pulse; or immediately after data is transferred to transmit buffer 1 Immediately after rise of last SCLK pulse Immediately after rise of next SCLK pulse (rise mode); in fall mode, immediately after fall of next SCLK pulse
Underrun error generation timing
SCLK output mode SCLK input mode
Note 1: Do not modify any control register during transmission or reception (while reception is enabled). Note 2: Do not disable reception (by setting SC0MOD0 to 0) while data is being received.
TMP1942CY/CZ-249
TMP1942CY/CZ 3.11.3 Register description
7
SC0MOD0 (0xFFFF_F232) Bit symbol Read/Write After reset Function 0 Transmit data bit 8 0 Handsha-ki ng function control 0: Disable CTS 1: Enable CTS 0 Receive control 0: Disable reception 1: Enable reception 0 Wake-up function 0: Disable 1: Enable TB8
6
CTSE
5
RXE
4
WU R/W
3
SM1 0
2
SM0 0
1
SC1 0
0
SC0 0
Serial transfer mode 00: I/O interface mode 01: 7-bit UART mode 10: 8-bit UART mode 11: 9-bit UART mode
Serial transfer clock (for UART) 00: Timer TA6TRG 01: Baud rate generator 10: Internal clock fsys/2 11: External clock (SCLK0 input)
Note: In I/O interface mode, the clock is selected using the serial control register (SC0CR).
Wake-up function 9-bit UART mode 0 1 Interrupt when data is received Interrupt only when RB8 = 1 Other modes
Don't care
Handshaking function ( CTS pin) enable 0 1 Disable (continuous transmission allowed) Enable
Note: Do not set RXE to 1 while setting each mode register (SC0MOD0, SC0MOD1, and SC0MOD2). Set RXE to 1 after setting all other register bits. Figure 3.11.6 Serial Mode Control Register 0 (SC0MOD0, for SIO0)
7
SC0MOD1 (0xFFFF_F235) Bit symbol Read/Write After reset Function I2S0 R/W 0
6
FDPX0 R/W 0
5
SIOEN R/W 0 SIO operation 0: Disable 1: Enable
4
-- -- --
3
-- -- --
2
-- -- --
1
-- -- --
0
-- -- --
Sync IDLE format 0: Idle 1: Running 0:Half-dupl ex 1:Full-dupl ex
: Enables or disables a clock supply to SIO module components other than registers. Note: When setting SIOEN to 1, set it before setting I2S0 and FDPX0.
Figure 3.11.7 Serial Mode Control Register 1 (SC0MOD1, for SIO0)
TMP1942CY/CZ-250
TMP1942CY/CZ
7
SC0MOD2 (0xFFFF_F236) Bit symbol Read/Write After reset Function 1 Transmit buffer empty flag 0: Full 1: Empty TBEMP
6
RBFLL 0 Receive buffer full flag 0: Empty 1: Full
5
TXRUN R/W 0 Transmi-ssi on in progress flag 0: Stopped 1:Transmi-t ting
4
SBLEN 0 STOP bit length 0: 1 bit 1: 2 bits
3
DRCHG 0
2
WBUF 0
1
SWRST1 W 0
0
SWRST0 W 0
Direction of Double-buff Soft reset transfer er enable Writing 10 then 01 0: LSB first 0: Disable triggers a reset. 1: MSB first 1: Enable
: Writing 10 and 01 in this order triggers a software reset. This initializes the mode register bits SC0MOD0, SC0MOD2, and , control register bits SC0CR, and , and the internal logic. : Enables or disables the double-buffer for transmission (SCLK output/input) and reception (SCLK output) in I/O interface mode and transmission in UART mode. In other modes, the double-buffer is always enabled regardless of the setting. Specifies the direction of transfer in I/O interface mode. In UART mode, this bit is fixed to 0 (LSB first). This bit is a status flag which indicates whether transmission shift operation is in progress. When this bit is set to 1, it indicates that data is being transmitted. When this bit is set to 0, it indicates that transmission is completely finished (if TBEMP = 1) or that the device is waiting with next transmit data stored in the transmit buffer (if TBEMP = 0). This bit is a flag which indicates whether the receive double-buffer is full. RBFIL is set to 1 when data has been transferred from the receive shift register to the receive double-buffer. It is cleared to 0 when the data has been read. This flag has no meaning if the double-buffer is disabled. This bit is a flag which indicates whether the transmit double-buffer is empty. TBEMP is set to 1 when data has been transferred from the transmit double-buffer to the transmit shift register, resulting in the transmit double-buffer being empty. It is cleared to 0 when transmit data has been written to the double-buffer. This flag has no meaning if the double-buffer is disabled. Specifies the transmit STOP bit length in UART mode. During reception, the device always recognizes a single STOP bit regardless of the setting of this bit.
: :
:
:
:
Note: If it is necessary to perform a soft reset during transmission, perform it twice consecutively. Figure 3.11.8 Serial Mode Control Register 2 (SC0MOD2, for SIO0)
TMP1942CY/CZ-251
TMP1942CY/CZ
7
SC1MOD0 (0xFFFF_F23A) Bit symbol Read/Write After reset Function 0 Transmit data bit 8 0 1: Enable CTS 0 Receive control 0: Disable reception 1: Enable reception 0 Wake-up function 0: Disable 1: Enable TB8
6
CTSE
5
RXE
4
WU R/W
3
SM1 0
2
SM0 0
1
SC1 0
0
SC0 0
Serial transfer mode 00: I/O interface mode 01: 7-bit UART mode 10: 8-bit UART mode 11: 9-bit UART mode
Serial transfer clock (for UART) 00: Timer TA6TRG 01: Baud rate generator 10: Internal clock fsys/2 11: External clock (SCLK1 input)
Note: In I/O interface mode, the clock is selected using the serial control register (SC1CR).
Wake-up function 9-bit UART mode 0 1 Interrupt when data is received Interrupt only when RB8 = 1 Other modes
Don't care
Note: Do not set RXE to 1 while setting each mode register (SC1MOD0, SC1MOD1, and SC1MOD2). Set RXE to 1 after setting all other register bits. Figure 3.11.9 Serial Mode Control Register 0 (SC1MOD0, for SIO1)
7
SC1MOD1 (0xFFFF_F23D) Bit symbol Read/Write After reset Function I2S0 R/W 0
6
FDPX0 R/W 0
5
SIOEN R/W 0 SIO operation 0: Disable 1: Enable
4
-- -- --
3
-- -- --
2
-- -- --
1
-- -- --
0
-- -- --
I Idle Sync format 0: Idle 1: Running 0:Half-dupl ex 1:Full-dupl ex
: Enables or disables a clock supply to SIO module components other than registers. Note: When setting SIOEN to 1, set it before setting I2S0 and FDPX0.
Figure 3.11.10 Serial Mode Control Register 1 (SC1MOD1, for SIO1)
TMP1942CY/CZ-252
TMP1942CY/CZ
7
SC0MOD2 (0xFFFF_F23E) Bit symbol Read/Write After reset Function 1 Transmit buffer empty flag 0: Full 1: Empty TBEMP
6
RBFLL 0 Receive buffer full flag 0: Empty 1: Full
5
TXRUN R/W 0 Transmi-ssi on in progress flag 0: Stopped 1:Transmi-t ting
4
SBLEN 0 STOP bit length 0: 1 bit 1: 2 bits
3
DRCHG 0
2
WBUF 0
1
SWRST1 W 0
0
SWRST0 W 0
Direction of Double-buff Soft reset transfer er enable Writing 10 then 01 0: LSB first 0: Disable triggers a reset. 1: MSB first 1: Enable
: Writing 10 and 01 in this order triggers a software reset. This initializes the mode register bits SC1MOD0, SC1MOD2, and , control register bits SC1CR, and , and the internal logic. : Enables or disables the double-buffer for transmission (SCLK output/input) and reception (SCLK output) in I/O interface mode and transmission in UART mode. In other modes, the double-buffer is always enabled regardless of the setting. Specifies the direction of transfer in I/O interface mode. In UART mode, this bit is fixed to 0 (LSB first). This bit is a status flag which indicates whether transmission shift operation is in progress. When this bit is set to 1, it indicates that data is being transmitted. When this bit is set to 0, it indicates that transmission is completely finished (if TBEMP = 1) or that the device is waiting with next transmit data stored in the transmit buffer (if TBEMP = 0). This bit is a flag which indicates whether the receive double-buffer is full. RBFIL is set to 1 when data has been transferred from the receive shift register to the receive double-buffer. It is cleared to 0 when the data has been read. This flag has no meaning if the double-buffer is disabled. This bit is a flag which indicates whether the transmit double-buffer is empty. TBEMP is set to 1 when data has been transferred from the transmit double-buffer to the transmit shift register, resulting in the transmit double-buffer being empty. It is cleared to 0 when transmit data has been written to the double-buffer. This flag has no meaning if the double-buffer is disabled. Specifies the transmit STOP bit length in UART mode. During reception, the device always recognizes a single STOP bit regardless of the setting of this bit.
: :
:
:
:
Note: If it is necessary to perform a soft reset during transmission, perform it twice consecutively. Figure 3.11.11 Serial Mode Control Register 2 (SC1MOD2, for SIO1)
TMP1942CY/CZ-253
TMP1942CY/CZ
7
SC3MOD0 (0x0FFFF_F282) Bit symbol Read/Write After reset Function 0 Transmit data bit 8 TB8
6
CTSE 0 1: Enable CTS
5
RXE 0 Receive control
4
WU R/W 0 Wake-up function
3
SM1 0
2
SM0 0
1
SC1 0
0
SC0 0
0: Disable 0: Disable reception 1: Enable 1: Enable reception
Serial transfer mode 00: I/O interface mode 01: 7-bit UART mode 10: 8-bit UART mode 11: 9-bit UART mode
Serial transfer clock (for UART) 00: Timer TA6TRG 01: Baud rate generator 10: Internal clock fsys/2 11: External clock (SCLK1 input)
Wake-up function 9-bit UART mode 0 1 Interrupt when data is received Interrupt only when RB8 = 1 Other modes
Don't care
Note: Do not set RXE to 1 while setting each mode register (SC3MOD0, SC3MOD1, and SC3MOD2). Set RXE to 1 after setting all other register bits. Figure 3.11.12 Serial Mode Control Register 0 (SC3MOD0, for SIO3)
7
SC3MOD1 (0xFFFF_F285) Bit symbol Read/Write After reset Function I2S0 R/W 0
6
FDPX0 R/W 0
5
SIOEN R/W 0 SIO operation 0: Disable 1: Enable
4
-- -- --
3
-- -- --
2
-- -- --
1
-- -- --
0
-- -- --
Idle Sync format 0: Idle 1: Running 0:Half-dupl ex 1:Full-dupl ex
: Enables or disables a clock supply to SIO module components other than registers. Note: When setting SIOEN to 1, set it before setting I2S0 and FDPX0.
Figure 3.11.13 Serial Mode Control Register 1 (SC3MOD1, for SIO3)
TMP1942CY/CZ-254
TMP1942CY/CZ
7
Bit symbol Read/Write After reset Function 1 Transmit buffer empty flag 0: Full 1: Empty TBEMP
6
RBFLL 0 Receive buffer full flag 0: Empty 1: Full
5
TXRUN R/W 0 Transmi-ssi on in progress flag 0: Stopped 1:Transmi-t ting
4
SBLEN 0 STOP bit length 0: 1 bit 1: 2 bits
3
DRCHG 0
2
WBUF 0
1
SWRST1 W 0
0
SWRST0 W 0
Direction of Double-buff Soft reset transfer er enable Writing 10 then 01 0: LSB first 0: Disable triggers a reset. 1: MSB first 1: Enable
: Writing 10 and 01 in this order triggers a software reset. This initializes the mode register bits SC3MOD0, SC3MOD2, and , control register bits SC3CR, and , and the internal logic. : Enables or disables the double-buffer for transmission (SCLK output/input) and reception (SCLK output) in I/O interface mode and transmission in UART mode. In other modes, the double-buffer is always enabled regardless of the setting. Specifies the direction of transfer in I/O interface mode. In UART mode, this bit is fixed to 0 (LSB first). This bit is a status flag which indicates whether transmission shift operation is in progress. When this bit is set to 1, it indicates that data is being transmitted. When this bit is set to 0, it indicates that transmission is completely finished (if TBEMP = 1) or that the device is waiting with next transmit data stored in the transmit buffer (if TBEMP = 0). This bit is a flag which indicates whether the receive double-buffer is full. RBFIL is set to 1 when data has been transferred from the receive shift register to the receive double-buffer. It is cleared to 0 when the data has been read. This flag has no meaning if the double-buffer is disabled. This bit is a flag which indicates whether the transmit double-buffer is empty. TBEMP is set to 1 when data has been transferred from the transmit double-buffer to the transmit shift register, resulting in the transmit double-buffer being empty. It is cleared to 0 when transmit data has been written to the double-buffer. This flag has no meaning if the double-buffer is disabled. Specifies the transmit STOP bit length in UART mode.
: :
:
:
:
Note: If it is necessary to perform a soft reset during transmission, perform it twice consecutively. Figure 3.11.14 Serial Mode Control Register 2 (SC3MOD2, for SIO3)
TMP1942CY/CZ-255
TMP1942CY/CZ
7
SC4MOD0 (0xFFFF_F28A) Bit symbol Read/Write After reset Function 0 Transmit data bit 8 TB8
6
CTSE 0 1: Enable CTS
5
RXE 0 Receive control
4
WU R/W 0 Wake-up function
3
SM1 0
2
SM0 0
1
SC1 0
0
SC0 0
0: Disable 0: Disable reception 1: Enable 1: Enable reception
Serial transfer mode 00: Reserved 01: 7-bit UART mode 10: 8-bit UART mode 11: 9-bit UART mode
Serial transfer clock (for UART) 00: Timer TA6TRG 01: Baud rate generator 10: Internal clock fsys/2 11: Don't care
Wake-up function 9-bit UART mode 0 1 Interrupt when data is received Interrupt only when RB8 = 1 Other modes
Don't care
Note: Do not set RXE to 1 while setting each mode register (SC4MOD0, SC4MOD1, and SC4MOD2). Set RXE to 1 after setting all other register bits. Figure 3.11.15 Serial Mode Control Register 0 (SC4MOD0, for SIO4)
7
SC4MOD1 (0xFFFF_F28D) Bit symbol Read/Write After reset Function I2S0 R/W 0
6
FDPX0 R/W 0
5
SIOEN R/W 0 SIO operation 0: Disable 1: Enable
4
-- -- --
3
-- -- --
2
-- -- --
1
-- -- --
0
-- -- --
Idle Sync format 0: Idle 1: Running 0:Half-dupl ex 1:Full-dupl ex
: Enables or disables a clock supply to SIO module components other than registers. Note: When setting SIOEN to 1, set it before setting I2S0 and FDPX0.
Figure 3.11.16 Serial Mode Control Register 1 (SC4MOD1, for SIO4)
TMP1942CY/CZ-256
TMP1942CY/CZ
7
SC4MOD2 (0xFFFF_F28E) Bit symbol Read/Write After reset Function 1 Transmit buffer empty flag 0: Full 1: Empty TBEMP
6
RBFLL 0 Receive buffer full flag 0: Empty 1: Full
5
TXRUN R/W 0 Transmi-ssi on in progress flag 0: Stopped 1:Transmi-t ting
4
SBLEN 0 STOP bit length 0: 1 bit 1: 2 bits
3
DRCHG 0
2
WBUF 0
1
SWRST1 W 0
0
SWRST0 W 0
Direction of Double-buf Soft reset transfer fer enable Writing 10 then 01 0: LSB first 0: Disable triggers a reset. 1: MSB first 1: Enable
: Writing 10 and 01 in this order triggers a software reset. This initializes the mode register bits SC4MOD0, SC4MOD2, and , control register bits SC4CR, and , and the internal logic. : Enables or disables the double-buffer for transmission (SCLK output/input) and reception (SCLK output) in I/O interface mode and transmission in UART mode. In other modes, the double-buffer is always enabled regardless of the setting. Specifies the direction of transfer in I/O interface mode. In UART mode, this bit is fixed to 0 (LSB first). This bit is a status flag which indicates whether transmission shift operation is in progress. When this bit is set to 1, it indicates that data is being transmitted. When this bit is set to 0, it indicates that transmission is completely finished (if TBEMP = 1) or that the device is waiting with next transmit data stored in the transmit buffer (if TBEMP = 0). This bit is a flag which indicates whether the receive double-buffer is full. RBFIL is set to 1 when data has been transferred from the receive shift register to the receive double-buffer. It is cleared to 0 when the data has been read. This flag has no meaning if the double-buffer is disabled. This bit is a flag which indicates whether the transmit double-buffer is empty. TBEMP is set to 1 when data has been transferred from the transmit double-buffer to the transmit shift register, resulting in the transmit double-buffer being empty. It is cleared to 0 when transmit data has been written to the double-buffer. This flag has no meaning if the double-buffer is disabled. Specifies the transmit STOP bit length in UART mode. During reception, the device always recognizes a single STOP bit regardless of the setting of this bit.
: :
:
:
:
Note: If it is necessary to perform a soft reset during transmission, perform it twice consecutively. Figure 3.11.17 Serial Mode Control Register 2 (SC4MOD2, for SIO4)
TMP1942CY/CZ-257
TMP1942CY/CZ
7
SC5MOD0 (0xFFFF_F292) Bit symbol Read/Write After reset Function 0 Transmit data bit 8 TB8
6
CTSE 0 1: Enable CTS
5
RXE 0 Receive control
4
WU R/W 0 Wake-up function
3
SM1 0
2
SM0 0
1
SC1 0
0
SC0 0
0: Disable 0: Disable reception 1: Enable 1: Enable reception
Serial transfer mode 00: Reserved 01: 7-bit UART mode 10: 8-bit UART mode 11: 9-bit UART mode
Serial transfer clock (for UART) 00: Timer TA6TRG 01: Baud rate generator 10: Internal clock fsys/2 11: Don't care
Wake-up function 9-bit UART mode 0 1 Interrupt when data is received Interrupt only when RB8 = 1 Other modes
Don't care
Note: Do not set RXE to 1 while setting each mode register (SC5MOD0, SC5MOD1, and SC5MOD2). Set RXE to 1 after setting all other register bits. Figure 3.11.18 Serial Mode Control Register 0 (SC5MOD0, for SIO5)
7
SC5MOD1 (0xFFFF_F295) Bit symbol Read/Write After reset Function I2S0 R/W 0
6
FDPX0 R/W 0
5
SIOEN R/W 0 SIO operation 0: Disable 1: Enable
4
-- -- --
3
-- -- --
2
-- -- --
1
-- -- --
0
-- -- --
I Idle Sync format 0: Idle 1: Running 0:Half-dupl ex 1:Full-dupl ex
: Enables or disables a clock supply to SIO module components other than registers. Note: When setting SIOEN to 1, set it before setting I2S0 and FDPX0.
Figure 3.11.19 Serial Mode Control Register 1 (SC5MOD1, for SIO5)
TMP1942CY/CZ-258
TMP1942CY/CZ
7
SC5MOD2 (0xFFFF_F296) Bit symbol Read/Write After reset Function 1 Transmit buffer empty flag 0: Full 1: Empty TBEMP
6
RBFLL 0 Receive buffer full flag 0: Empty 1: Full
5
TXRUN R/W 0 Transmi-ssi on in progress flag 0: Stopped 1: Transmitting
4
SBLEN 0 STOP bit length 0: 1 bit 1: 2 bits
3
DRCHG 0
2
WBUF 0
1
SWRST1 W 0
0
SWRST0 W 0
Direction of Double-buf Soft reset transfer fer enable Writing 10 then 01 0: LSB first 0: Disable triggers a reset. 1: MSB first 1: Enable
: Writing 10 and 01 in this order triggers a software reset. This initializes the mode register bits SC5MOD0, SC5MOD2, and , control register bits SC5CR, and , and the internal logic. : Enables or disables the double-buffer for transmission (SCLK output/input) and reception (SCLK output) in I/O interface mode and transmission in UART mode. In other modes, the double-buffer is always enabled regardless of the setting. Specifies the direction of transfer in I/O interface mode. In UART mode, this bit is fixed to 0 (LSB first). This bit is a status flag which indicates whether transmission shift operation is in progress. When this bit is set to 1, it indicates that data is being transmitted. When this bit is set to 0, it indicates that transmission is completely finished (if TBEMP = 1) or that the device is waiting with next transmit data stored in the transmit buffer (if TBEMP = 0). This bit is a flag which indicates whether the receive double-buffer is full. RBFIL is set to 1 when data has been transferred from the receive shift register to the receive double-buffer. It is cleared to 0 when the data has been read. This flag has no meaning if the double-buffer is disabled. This bit is a flag which indicates whether the transmit double-buffer is empty. TBEMP is set to 1 when data has been transferred from the transmit double-buffer to the transmit shift register, resulting in the transmit double-buffer being empty. It is cleared to 0 when transmit data has been written to the double-buffer. This flag has no meaning if the double-buffer is disabled. Specifies the transmit STOP bit length in UART mode. During reception, the device always recognizes a single STOP bit regardless of the setting of this bit.
: :
:
:
:
Note: If it is necessary to perform a soft reset during transmission, perform it twice consecutively. Figure 3.11.20 Serial Mode Control Register 2 (SC5MOD2, for SIO5)
TMP1942CY/CZ-259
TMP1942CY/CZ
7
SC0CR (0xFFFF_F231) Bit symbol Read/Write After reset Function RB8 R -- Receive data bit 8
6
EVEN R/W 0
5
PE 0
4
OERR 0
3
PERR 0 1: Error
2
FERR 0
1
SCLKS R/W 0 0: SCLK0
0
IOC 0 0: Baud rate generator 1: SCLK0 pin input
R (cleared to 0 when read)
Parity type Parity 0: Odd 0: Disabled 1: Even 1: Enabled Overrun
Parity /underrun
Framing
1: SCLK0
I/O interface input clock selection 0 1 Baud rate generator SCLK0 pin input
Active edge selection for SCLK0 input 0 1 Data transmitted/received at rising edge of SCLK0 Data transmitted/received at falling edge of SCLK0 Cleared to 0 when read
Framing error flag Parity error/underrun error flag Overrun error flag Parity type 0 1 Odd parity Even parity
Note 1: All error flags are cleared to 0 when read. Note 2: For SCLK output operation, set SCLKS to 0 (rising edge). Figure 3.11.21 Serial Control Register (SC0CR, for SIO0)
TMP1942CY/CZ-260
TMP1942CY/CZ
7
SC1CR (0xFFFF_F239) Bit symbol Read/Write After reset Function RB8 R -- Receive data bit 8
6
EVEN R/W 0
5
PE 0
4
OERR 0
3
PERR 0 1: Error
2
FERR 0
1
SCLKS R/W 0
0
IOC 0
R (cleared to 0 when read)
Parity type Parity 0: Odd 0: Disabled 1: Even 1: Enabled Overrun
0: SCLK0 0: Baud rate generator 1: SCLK0 1: SCLK0 pin input
Parity/ underrun
Framing
I/O interface input clock selection 0 1 Baud rate generator SCLK0 pin input
Active edge selection for SCLK0 input 0 1 Data transmitted/received at rising edge of SCLK0 Data transmitted/received at falling edge of SCLK0 Cleared to 0 when read
Framing error flag Parity error/underrun error flag Overrun error flag Parity type 0 1 Odd parity Even parity
Note 1: All error flags are cleared to 0 when read. Note 2: For SCLK output operation, set SCLKS to 0 (rising edge). Figure 3.11.22 Serial Control Register (SC1CR, for SIO1)
TMP1942CY/CZ-261
TMP1942CY/CZ
7
SC3CR (0xFFFF_F281) Bit symbol Read/Write After reset Function RB8 R -- Receive data bit 8
6
EVEN R/W 0
5
PE 0
4
OERR 0
3
PERR 0 1: Error
2
FERR 0
1
SCLKS R/W 0 0: SCLK0
0
IOC 0 0: Baud rate generator 1: SCLK0 pin input
R (cleared to 0 when read)
Parity type Parity 0: Odd 0: Disabled 1: Even 1: Enabled Overrun
Parity/ underrun
Framing
1: SCLK0
I/O interface input clock selection 0 1 Baud rate generator SCLK0 pin input
Active edge selection for SCLK0 input 0 1 Data transmitted/received at rising edge of SCLK0 Data transmitted/received at falling edge of SCLK0 Cleared to 0 when read
Framing error flag Parity error/underrun error flag Overrun error flag Parity type 0 1 Odd parity Even parity
:
In both UART and I/O interface modes, an overrun error occurs when all bits of the next frame have been received before data stored in the receive buffer is read out completely. An overrun error causes the OERR flag to be set. In UART mode, the PERR flag is set to 1 when a parity error occurs. Reading the PERR flag clears it to 0. In I/O interface mode, the PERR bit indicates an underrun error. When SC0MOD2 is set to 1, an underrun error occurs in the following case: In SCLK input mode, it occurs if data stored in the transmit shift register has been transmitted but no data is set in the transmit double-buffer. In other modes, this flag is not set. Reading the flag clears it to 0. In UART mode, the FERR flag is set to 1 when a framing error occurs. Reading the flag clears it to 0.
:
:
Note 1: All error flags are cleared to 0 when read. Note 2: For SCLK output operation, set SCLKS to 0 (rising edge). Figure 3.11.23 Serial Control Register (SC3CR, for SIO3)
TMP1942CY/CZ-262
TMP1942CY/CZ
7
SC4CR (0xFFFF_F289) Bit symbol Read/Write After reset Function RB8 R -- Receive data bit 8
6
EVEN R/W 0
5
PE 0
4
OERR 0
3
PERR 0 1: Error
2
FERR 0
1
SCLKS R/W 0 0: SCLK0
0
IOC 0 0: Baud rate generator 1: SCLK0 pin input
R (cleared to 0 when read)
Parity type Parity 0: Odd 0: Disabled 1: Even 1: Enabled Overrun
Parity/ underrun
Framing
1: SCLK0
I/O interface input clock selection 0 1 Baud rate generator SCLK0 pin input
Active edge selection for SCLK0 input 0 1 Data transmitted/received at rising edge of SCLK0 Data transmitted/received at falling edge of SCLK0 Cleared to 0 when read
Framing error flag Parity error/underrun error flag Overrun error flag Parity type 0 1 Odd parity Even parity
Note 1: All error flags are cleared to 0 when read. Note 2: For SCLK output operation, set SCLKS to 0 (rising edge). Figure 3.11.24 Serial Control Register (SC4CR, for SIO4)
TMP1942CY/CZ-263
TMP1942CY/CZ
7
SC5CR (0xFFFF_F293) Bit symbol Read/Write After reset Function RB8 R -- Receive data bit 8
6
EVEN R/W 0
5
PE 0
4
OERR 0
3
PERR 0 1: Error
2
FERR 0
1
SCLKS R/W 0 0: SCLK0
0
IOC 0 0: Baud rate generator 1: SCLK0 pin input
R (cleared to 0 when read)
Parity type Parity 0: Odd 0: Disabled 1: Even 1: Enabled Overrun
Parity/ underrun
Framing
1: SCLK0
I/O interface input clock selection 0 1 Baud rate generator SCLK0 pin input
Active edge selection for SCLK0 input 0 1 Data transmitted/received at rising edge of SCLK0 Data transmitted/received at falling edge of SCLK0 Cleared to 0 when read
Framing error flag Parity error/underrun error flag Overrun error flag Parity type 0 1 Odd parity Even parity
Note 1: All error flags are cleared to 0 when read. Note 2: For SCLK output operation, set SCLKS to 0 (rising edge). Figure 3.11.25 Serial Control Register (SC5CR, for SIO5)
TMP1942CY/CZ-264
TMP1942CY/CZ
7
BR0CR (0xFFFF_F233) Bit symbol Read/Write After reset Function 0 Must always be set to 0. 0 Division by
N+(16-K)/16
6
BR0ADDE
5
BR0CK1 0 00: T0 01: T2 10: T8 11: T32
4
BR0CK0 R/W 0
3
BR0S3 0
2
BR0S2 0
1
BR0S1 0
0
BR0S0 0
--
Sets value of divisor N
0: Disable 1: Enable
Selects baud rate generator input clock 00 Internal clock T0 01 Internal clock T2 10 Internal clock T8 11 Internal clock T32
7
BR0ADD (0xFFFF_F234) Bit symbol Read/Write After reset Function

6

5

4

3
BR0K3 0
2
BR0K2 R/W 0
1
BR0K1 0
0
BR0K0 0
Sets K value for division by N + (16-K)/16
Sets divisor value for baud rate generator BR0CR = 1 BR0ADD 0000 (N = 16)
~
BR0CR = 0 0001 (N = 1) (ONLY UART) 1111 (N = 15) 0000 (N = 16)
~
BR0CR 0010 (N = 2) 1111 (N = 15) Invalid Divided by N + (16-K)/16
~
0001 (N = 1) 0000 0001 (K = 1) 1111 (K = 15)
~
Invalid Invalid
Divided by N
Note 1: The baud rate generator divisor cannot be set to 1 in UART mode if division by N+(16-K)/16 is being used. It cannot be set to 1 at all in I/O interface mode. Note 2: When using division by N+(16-K)/16, be sure to set K (1 to 15) in BR0ADD before setting BR0CR to 1. However, if BR0CR = 0000 or 0001 (i.e. if N = 16 or 1), do not use division by N+(16-K)/16. Note 3: Division by N+(16-K)/16 can only be used in UART mode. In I/O interface mode, set BR0CR to 0 to disable division by N+(16-K)/16. Figure 3.11.26 Baud Rate Generator Control Registers (BR0CR and BR0ADD, for SIO0)
TMP1942CY/CZ-265
TMP1942CY/CZ
7
BR1CR (0xFFFF_F23B) Bit symbol Read/Write After reset Function 0 Must always be set to 0. 0 Division by
N+(16-K)/16
6
BR1ADDE
5
BR1CK1 0 00: T0 01: T2 10: T8 11: T32
4
BR1CK0 R/W 0
3
BR1S3 0
2
BR1S2 0
1
BR1S1 0
0
BR1S0 0
--
Sets value of divisor N
0: Disable 1: Enable
Selects baud rate generator input clock 00 Internal clock T0 01 Internal clock T2 10 Internal clock T8 11 Internal clock T32
7
BR1ADD (0xFFFF_F23C) Bit symbol Read/Write After reset Function

6

5

4

3
BR1K3 0
2
BR1K2 R/W 0
1
BR1K1 0
0
BR1K0 0
Sets K value for division by N+(16-K)/16
Sets divisor value for baud rate generator BR0CR = 1 BR0ADD 0000 (N = 16)
~
BR0CR = 0 0001 (N = 1) (ONLY UART) 1111 (N = 15) 0000 (N = 16)
~
BR0CR 0010 (N = 2) 1111 (N = 15) Invalid Divided by N + (16-K)/16
~
0001 (N = 1) 0000 0001 (K = 1) 1111 (K = 15)
~
Invalid Invalid
Divided by N
Note 1: The baud rate generator divisor cannot be set to 1 in UART mode if division by N+(16-K)/16 is being used. It cannot be set to 1 at all in I/O interface mode. Note 2: When using division by N+(16-K)/16, be sure to set K (1 to 15) in BR1ADD before setting BR1CR to 1. However, if BR1CR = 0000 or 0001 (i.e. if N = 16 or 1), do not use division by N+(16-K)/16. Note 3: Division by N+(16-K)/16 can only be used in UART mode. In I/O interface mode, set BR1CR to 0 to disable division by N+(16-K)/16. Figure 3.11.27 Baud Rate Generator Control Registers (BR1CR and BR1ADD, for SIO1)
TMP1942CY/CZ-266
TMP1942CY/CZ
7
BR3CR (0xFFFF_F283) Bit symbol Read/Write After reset Function 0 Must always be set to 0. 0 Division by
N+(16-K)/16
6
BR3ADDE
5
BR3CK1 0 00: T0 01: T2 10: T8 11: T32
4
BR3CK0 R/W 0
3
BR3S3 0
2
BR3S2 0
1
BR3S1 0
0
BR3S0 0
--
Sets value of divisor N
0: Disable 1: Enable
Selects baud rate generator input clock 00 Internal clock T0 01 Internal clock T2 10 Internal clock T8 11 Internal clock T32
7
BR3ADD (0xFFFF_F284) Bit symbol Read/Write After reset Function

6

5

4

3
BR3K3 0
2
BR3K2 R/W 0
1
BR3K1 0
0
BR3K0 0
Sets K value for division by N+(16-K)/16
Sets divisor value for baud rate generator BR0CR = 1 BR0ADD 0000 (N = 16)
~
BR0CR = 0 0001 (N = 1) (ONLY UART) 1111 (N = 15) 0000 (N = 16)
~
BR0CR 0010 (N = 2) 1111 (N = 15) Invalid Divided by N + (16-K)/16
~
0001 (N = 1) 0000 0001 (K = 1) 1111 (K = 15)
~
Invalid Invalid
Divided by N
Note 1: The baud rate generator divisor cannot be set to 1 in UART mode if division by N+(16-K)/16 is being used. It cannot be set to 1 at all in I/O interface mode. Note 2: When using division by N+(16-K)/16, be sure to set K (1 to 15) in BR3ADD before setting BR3CR to 1. However, if BR3CR = 0000 or 0001 (i.e. if N = 16 or 1), do not use division by N+(16-K)/16. Note 3: Division by N+(16-K)/16 can only be used in UART mode. In I/O interface mode, set BR3CR to 0 to disable division by N+(16-K)/16. Figure 3.11.28 Baud Rate Generator Control Registers (BR3CR and BR3ADD, for SIO3)
TMP1942CY/CZ-267
TMP1942CY/CZ
7
BR4CR (0xFFFF_F28B) Bit symbol Read/Write After reset Function 0 Must always be set to 0. 0 Division by
N+(16-K)/16
6
BR4ADDE
5
BR4CK1 0 00: T0 01: T2 10: T8 11: T32
4
BR4CK0 R/W 0
3
BR4S3 0
2
BR4S2 0
1
BR4S1 0
0
BR4S0 0
--
Sets value of divisor N
0: Disable 1: Enable
Selects baud rate generator input clock 00 Internal clock T0 01 Internal clock T2 10 Internal clock T8 11 Internal clock T32
7
BR4ADD (0xFFFF_F28C) Bit symbol Read/Write After reset Function

6

5

4

3
BR4K3 0
2
BR4K2 R/W 0
1
BR4K1 0
0
BR4K0 0
Sets K value for division by N+(16-K)/16
Sets divisor value for baud rate generator BR0CR = 1 BR0ADD 0000 (N = 16)
~
BR0CR = 0 0001 (N = 1) (ONLY UART) 1111 (N = 15) 0000 (N = 16)
~
BR0CR 0010 (N = 2) 1111 (N = 15) Invalid Divided by N + (16-K)/16
~
0001 (N = 1) 0000 0001 (K = 1) 1111 (K = 15)
~
Invalid Invalid
Divided by N
Note 1: The baud rate generator divisor cannot be set to 1 in UART mode if division by N+(16-K)/16 is being used. It cannot be set to 1 at all in I/O interface mode. Note 2: When using division by N+(16-K)/16, be sure to set K (1 to 15) in BR4ADD before setting BR4CR to 1. However, if BR4CR = 0000 or 0001 (i.e. if N = 16 or 1), do not use division by N+(16-K)/16. Note 3: Division by N+(16-K)/16 can only be used in UART mode. In I/O interface mode, set BR4CR to 0 to disable division by N+(16-K)/16. Figure 3.11.29 Baud Rate Generator Control Registers (BR4CR and BR4ADD, for SIO4)
TMP1942CY/CZ-268
TMP1942CY/CZ
7
BR5CR (0xFFFF_F293) Bit symbol Read/Write After reset Function 0 Must always be set to 0. 0 Division by
N+(16-K)/16
6
BR5ADDE
5
BR5CK1 0 00: T0 01: T2 10: T8 11: T32
4
BR5CK0 R/W 0
3
BR5S3 0
2
BR5S2 0
1
BR5S1 0
0
BR5S0 0
--
Sets value of divisor N
0: Disable 1: Enable
Selects baud rate generator input clock 00 Internal clock T0 01 Internal clock T2 10 Internal clock T8 11 Internal clock T32
7
BR5ADD (0xFFFF_F294) Bit symbol Read/Write After reset Function

6

5

4

3
BR5K3 0
2
BR5K2 R/W 0
1
BR5K1 0
0
BR5K0 0
Sets K value for division by N+(16-K)/16
Sets divisor value for baud rate generator BR0CR = 1 BR0ADD 0000 (N = 16)
~
BR0CR = 0 0001 (N = 1) (ONLY UART) 1111 (N = 15) 0000 (N = 16)
~
BR0CR 0010 (N = 2) 1111 (N = 15) Invalid Divided by N + (16-K)/16
~
0001 (N = 1) 0000 0001 (K = 1) 1111 (K = 15)
~
Invalid Invalid
Divided by N
Note 1: The baud rate generator divisor cannot be set to 1 in UART mode if division by N+(16-K)/16 is being used. It cannot be set to 1 at all in I/O interface mode. Note 2: When using division by N+(16-K)/16, be sure to set K (1 to 15) in BR5ADD before setting BR5CR to 1. However, if BR5CR = 0000 or 0001 (i.e. if N = 16 or 1), do not use division by N+(16-K)/16. Note 3: Division by N+(16-K)/16 can only be used in UART mode. In I/O interface mode, set BR5CR to 0 to disable division by N+(16-K)/16. Figure 3.11.30 Baud Rate Generator Control Registers (BR5CR and BR5ADD, for SIO5)
TMP1942CY/CZ-269
TMP1942CY/CZ
7 TB7 SC0BUF (0xFFFF_F230) 7 RB7 6 TB6 6 RB6 5 TB5 5 RB5 4 TB4 4 RB4 3 TB3 3 RB3 2 TB2 2 RB2 1 TB1 1 RB1 0 TB0 0 RB0 (For reception) (For transmission)
Figure 3.11.31 Serial Transmit/Receive Buffer Register (SC0BUF, for SIO0)
7 TB7 SC1BUF (0xFFFF_F238) 7 RB7
6 TB6 6 RB6
5 TB5 5 RB5
4 TB4 4 RB4
3 TB3 3 RB3
2 TB2 2 RB2
1 TB1 1 RB1
0 TB0 0 RB0 (For reception) (For transmission)
Figure 3.11.32 Serial Transmit/Receive Buffer Register (SC1BUF, for SIO1)
7 TB7 SC3BUF (0xFFFF_F280) 7 RB7
6 TB6 6 RB6
5 TB5 5 RB5
4 TB4 4 RB4
3 TB3 3 RB3
2 TB2 2 RB2
1 TB1 1 RB1
0 TB0 0 RB0 (For reception) (For transmission)
Figure 3.11.33 Serial Transmit/Receive Buffer Register (SC3BUF, for SIO3)
7 TB7 SC4BUF (0xFFFF_F288) 7 RB7
6 TB6 6 RB6
5 TB5 5 RB5
4 TB4 4 RB4
3 TB3 3 RB3
2 TB2 2 RB2
1 TB1 1 RB1
0 TB0 0 RB0 (For reception) (For transmission)
Figure 3.11.34 Serial Transmit/Receive Buffer Register (SC4BUF, for SIO4)
7 TB7 SC5BUF (0xFFFF_F290) 7 RB7
6 TB6 6 RB6
5 TB5 5 RB5
4 TB4 4 RB4
3 TB3 3 RB3
2 TB2 2 RB2
1 TB1 1 RB1
0 TB0 0 RB0 (For reception) (For transmission)
Figure 3.11.35 Serial Transmit/Receive Buffer Register (SC5BUF, for SIO5)
TMP1942CY/CZ-270
TMP1942CY/CZ
3.11 11
3.11.4
Functional description for each mode
(1) Mode 0 (I/O interface mode) This mode comprises two submodes: SCLK output mode, in which the synchronizing clock SCLK is generated internally by the device, and SCLK input mode, in which the synchronizing clock SCLK is input from an external source. 1) Transmission If WBUF = 0, that is, the transmit double-buffer is disabled in SCLK output mode, 8 bits of data and the synchronizing clock signal are output on the TXD0 and SCLK0 pins, respectively, each time the CPU writes data to the transmit buffer. When all the data bits have been output, an INTTX0 interrupt is generated. If WBUF = 1, that is, the transmit double-buffer is enabled, data is transferred from transmit buffer 2 to transmit buffer 1 when the CPU writes data to transmit buffer 2 while transmission is stopped or when data has been transmitted from transmit buffer 1 (shift register). Simultaneously, SC0MOD2 is set to 1 and an INTTX0 interrupt occurs. If transmit buffer 2 does not contain data to be transferred to transmit buffer 1, SCLK0 output is stopped without generating an INTTX0 interrupt.
Timing at which transmit data is written to buffer SCLK0 output TXD0 (INTTX0 interrupt request) TBRUN When WBUF = 0 Timing at which transmit data is written to buffer SCLK0 output TXD0 (INTTX0 interrupt request) TBRUN TBEMP When WBUF = 1 (if buffer 2 contains data) Timing at which transmit data is written to buffer SCLK0 output TXD0 (INTTX0 interrupt request) TBRUN TBEMP When WBUF = 1 (if buffer 2 does not contain data) bit 0 bit 1 bit 6 bit 7 bit 0 bit 1 bit 6 bit 7 bit 0 bit 0 bit 1 bit 6 bit 7 bit 0
Figure 3.11.36 Transmit Operation in I/O Interface Mode (SCLK0 Output Mode)
TMP1942CY/CZ-271
TMP1942 CY/CZ
If WBUF = 0, that is, the transmit double-buffer is disabled in SCLK input mode, 8 bits of data are output on the TXD0 pin when the SCLK0 input becomes active with data present in the transmit buffer. When all the data bits have been output, an INTTX0 interrupt is generated. Writing the next transmit data must be completed before point A in the shown below. If WBUF = 1, that is, the transmit double-buffer is enabled, data is transferred from transmit buffer 2 to transmit buffer 1 when the CPU writes data to the transmit buffer before the SCLK0 input becomes active or when data has been transmitted from transmit buffer 1 (shift register). Simultaneously, SC0MOD2 is set to 1 and an INTTX0 interrupt occurs. If the SCLK0 input becomes active when transmit buffer 2 does not contain data, the internal bit counter starts counting but an underrun error flag is set, causing 8 bits of dummy data (FFh) to be transmitted.
Timing at which transmit data is written to buffer SCLK0 input (SCLKS =0: Rise mode) SCLK0 input (SCLKS =1: Fall mode) TXD0 (INTTX0 interrupt request) When WBUF = 0 Timing at which transmit data is written to buffer SCLK0 input (SCLKS =0: Rise mode) SCLK0 input (SCLKS =1: Fall mode) TXD0 (INTTX0 interrupt request) TBRUN TBEMP When WBUF = 1 (if buffer 2 contains data) Timing at which transmit data is written to buffer SCLK0 input (SCLKS =0: Rise mode) SCLK0 input (SCLKS =1: Fall mode) TXD0 (INTTX0 interrupt request) TBRUN TBEMP PERR (indicating underrun error) When WBUF = 1 (if buffer 2 does not contain data) bit 0 bit 1 bit 5 bit 6 bit 7 1 1 A bit 0 bit 1 bit 5 bit 6 bit 7 bit 0 bit 1 A bit 0 bit 1 bit 5 bit 6 bit 7 bit 0 bit 1 A
Figure 3.11.37 Transmit Operation in I/O Interface Mode (SCLK0 Input Mode)
TMPR1942CY/CZ-272
TMP1942CY/CZ
2) Reception If WBUF = 0, that is, the receive double-buffer is disabled in SCLK output mode, the synchronizing clock is output on the SCLK0 pin and the next data item is shifted into receive buffer 1 each time the received data is read by the CPU. When 8 bits of data have been received, an INTRX0 interrupt is generated. SCLK output is initiated by setting SC0MOD0 to 1. If WBUF = 1, that is, the receive double-buffer is enabled, the received frame is transferred to transmit buffer 2 and then the next frame is received into receive buffer 1. When data has been transferred from receive buffer 1 to receive buffer 2, SCnMOD2 is set to 1 and an INTRX0 interrupt occurs. If the CPU/DMAC does not read data from receive buffer 2 before the next eight bits of data have been received, an overrun error occurs, setting SCnCR. In that case, SCLK0 output is stopped without generating an INTRX0 interrupt. After an overrun error occurs, reading data from receive buffer 2 causes the data in receive buffer 1 to be transferred to receive buffer 2, generating an INTRX0 interrupt to restart reception.
Timing at which received data is written to buffer SCLK0 output RXD0 (INTRX0 interrupt request) When WBUF = 0 Timing at which received data is written to buffer SCLK0 output RXD0 (INTRX0 interrupt request) RBFULL When WBUF = 1 (if data is read from buffer 2) Timing at which received data is written to buffer SCLK0 output RXD0 (INTRX0 interrupt request) RBFULL When WBUF = 1 (if data is not read from buffer 2) bit7 bit 0 bit 1 bit 6 bit 7 bit7 bit 0 bit 1 bit 6 bit 7 bit 0 bit 0 bit 1 bit 6 bit 7 bit 0
Figure 3.11.38 Receive Operation in I/O Interface Mode (SCLK0 Output Mode)
TMP1942CY/CZ-273
TMP1942 CY/CZ
In SCLK input mode, the receive double-buffer is always enabled. The received frame is transferred to receive buffer 2, so that receive buffer 1 can receive the next frame immediately. Each time received data has been transferred to receive buffer 2, an INTRX0 interrupt occurs.
Timing at which received data is written to buffer SCLK0 input (SCLKS =0: Rise mode) SCLK0 input (SCLKS =1: Fall mode) RXD0 (INTRX0 interrupt request) RBFULL If data is read from buffer 2 bit 0 bit 1 bit 5 bit 6 bit 7 bit 0
Timing at which received data is written to buffer SCLK0 input (SCLKS =0: Rise mode) SCLK0 input (SCLKS =1: Fall mode) RXD0 (INTRX0 interrupt request) RBFULL OERR bit 0 bit 1 bit 5 bit 6 bit 7 bit 0
Figure 3.11.39 Receive Operation in I/O Interface Mode (SCLK0 Input Mode) Note: Before receive operation can be performed in either SCLK input mode or SCLK output mode, reception must be enabled by setting SC0MOD to 1. 3) Transmission/reception (full-duplex) Setting SC0MOD1 to 1 enables full-duplex communication. If WBUF = 0, that is, both the transmit and receive double-buffers are disabled in SCLK output mode, writing data to the transmit buffer initiates SCLK output and shifts the received 8-bit data into receive buffer 1, generating a receive interrupt (INTRX0). Simultaneously, the 8-bit data written to the transmit buffer is output on the TXD0 pin. When all bits of data have been transmitted, a transmit interrupt (INTTX0) is generated, causing SCLK output to stop. When the CPU subsequently reads the receive buffer and writes data to the transmit buffer, next transmission/reception starts. Transmission/reception is restarted when the CPU has performed both the read and write, regardless of their sequence.
TMPR1942CY/CZ-274
TMP1942CY/CZ
If WBUF = 1, that is, both the transmit and receive double-buffers are enabled, writing data to the transmit buffer initiates SCLK output and shifts the received 8-bit data into receive buffer 1, which is then transferred to receive buffer 2, generating a receive interrupt (INTRX0). Simultaneously, the 8-bit data written to the transmit buffer is output on the TXD0 pin. When all bits of data have been transmitted, a transmit interrupt (INTTX0) is generated and the next data is transferred from transmit buffer 2 to transmit buffer 1. If transmit buffer 2 does not contain data to be transferred (TBEMP = 1) or receive buffer 2 contains data (RBFLL = 1), SCLK output is stopped. When the CPU subsequently reads the receive buffer and writes data to the transmit buffer, SCLK output is restarted and next transmission/reception starts.
Timing at which received data is written to buffer Timing at which transmit data is written to buffer SCLK0 output TXD0 RXD0 (INTTX0 interrupt request) (INTRX0 interrupt request) When WBUF = 0 Timing at which received data is written to buffer Timing at which transmit data is written to buffer SCLK0 output TXD0 RXD0 (INTTX0 interrupt request) (INTRX0 interrupt request) When WBUF = 1 Timing at which received data is written to buffer Timing at which transmit data is written to buffer SCLK0 output TXD0 RXD0 (INTTX0 interrupt request) (INTRX0 interrupt request) When WBUF = 1 bit 0 bit 0 bit 1 bit 1 bit 5 bit 5 bit 6 bit 6 bit 7 bit 7 bit 0 bit 0 bit 1 bit 1 bit 5 bit 5 bit 6 bit 6 bit 7 bit 7 bit 0 bit 0 bit 1 bit 1 bit 0 bit 0 bit 1 bit 1 bit 5 bit 5 bit 6 bit 6 bit 7 bit 7 bit 0 bit 0 bit 1 bit 1
Figure 3.11.40 Transmit/Receive Operation in I/O Interface Mode (SCLK0 Output Mode)
TMP1942CY/CZ-275
TMP1942 CY/CZ
If WBUF = 0, that is, the transmit double-buffer is disabled in SCLK input mode (the receive double-buffer is always enabled in SCLK input mode), 8-bit data is output on the TXD0 pin and 8-bit data is shifted into the receive buffer simultaneously when the SCLK input becomes active with data present in the transmit buffer. When all bits of data have been transmitted, a transmit interrupt (INTTX0) is generated. When all bits of data have been received and then transferred from receive buffer 1 to receive buffer 2, a receive interrupt (INTRX0) is generated. Next transmit data must be written to the transmit buffer before the SCLK pulse for the next frame is input, that is, before point A in the figure below. Because the receive double-buffer is enabled, the received data must be read before the reception of the next frame is completed. If WBUF = 1, that is, both the transmit and receive double-buffers are enabled, the data in transmit buffer 2 is transferred to transmit buffer 1, generating a transmit interrupt (INTTX0), when all bits of data in transmit buffer 1 have been transmitted. When the received 8-bit data has been shifted into receive buffer 1, the data is transferred to receive buffer 2, generating a receive interrupt (INTRX0). Then, the SCLK input pulse for the next frame initiates the transmission of the data transferred from transmit buffer 2 to transmit buffer 1 and the reception of data into receive buffer 1. If the data in receive buffer 2 is not read before the last bit of the frame is received, an overrun error occurs. If transmit data is not written to transmit buffer 2 before the SCLK pulse for the next frame is input, an underrun error occurs.
Timing at which received data is written to buffer Timing at which transmit data is written to buffer SCLK0 input
A
TXD0 RXD0 (INTTX0 interrupt request) (INTRX0 interrupt request)
bit 0 bit 0
bit 1 bit 1
bit 5 bit 5
bit 6 bit 6
bit 7 bit 7
bit 0 bit 0
bit 1 bit 1
When WBUF = 0
TMPR1942CY/CZ-276
TMP1942CY/CZ
Timing at which received data is written to buffer Timing at which transmit data is written to buffer SCLK0 input
TXD0 RXD0 (INTTX0 interrupt request) (INTRX0 interrupt request)
bit 0 bit 0
bit 1 bit 1
bit 5 bit 5
bit 6 bit 6
bit 7 bit 7
bit 0 bit 0
bit 1 bit 1
When WBUF = 1 (without error)
Timing at which received data is written to buffer Timing at which transmit data is written to buffer SCLK0 input
TXD0 RXD0 (INTTX0 interrupt request) (INTRX0 interrupt request) PERR (underrun error)
bit 0 bit 0
bit 1 bit 1
bit 5 bit 5
bit 6 bit 6
bit 7 bit 7
bit 0 bit 0
bit 1 bit 1
When WBUF = 1 (if error occurs)
(2) Mode 1 (7-bit UART mode) Setting the SM1 and SM0 bits of the serial channel mode register SC0MOD to 01 places the device into 7-bit UART mode. In this mode, a parity bit can be used. Parity can be enabled or disabled using the PE bit of the serial channel control register SC0CR. When PE = 1 (parity enabled), even or odd parity can be selected using SC0CR. The STOP bit length can also be specified using SCnMOD2.
TMP1942CY/CZ-277
TMP1942 CY/CZ
Example: To transmit data in the following format, set the control registers as shown below.
start bit 0 1 2 3 4 5 6 even parity stop
Direction of transfer (transfer rate = 2400 bps at fc = 24.576 MHz) * Clock conditions System clock: High-speed clock gear: Prescaler clock: High-speed (fc) x 1 (fc) fperiph/4 (fperiph = fsys)
76543210 PDCR PDFC SC0MOD SC0CR BR0CR IMCCLH SC0BUF - - - - - - - 1 - - - - - - - 1 X0- X0101 X11XXX00 00101010 - - 110100 * * * * * * * * Set PD0 to TXD0 pin. Select 7-bit UART mode. Select even parity. Set transfer rate to 2400 bps. Enable INTTX0 interrupt and set its priority level to 4. Set transmit data.
Note: X = Don't care; "--" = No change
(3) Mode 2 (8-bit UART mode) Setting the SM1 and SM0 bits of SC0MOD to 10 places the device into 8-bit UART mode. In this mode, a parity bit can be used. Parity can be enabled or disabled using SC0CR. When PE = 1 (parity enabled), even or odd parity can be selected using SC0CR.
Example: To transmit data in the following format, set the control registers as shown below.
start bit 0 1 2 3 4 5 6 7 odd parity stop
Direction of transfer (transfer rate = 9600 bps at fc = 24.576 MHz) * Clock conditions System clock: High-speed clock gear: Prescaler clock: High-speed (fc) x 1 (fc) fperiph/4 (fperiph = fsys)
*
Setting in the main routine
76543210 PDCR SC0MOD SC0CR BR0CR IMCCLL SC0MOD - - - - - - 0- - 00X1001 X01XXX00 00010101 - - 110100 - - 1X- - - - Set PD1 (RxD0) to input pin. Select 8-bit UART mode. Select odd parity. Set transfer rate to 9600 bps. Enable INTRX0 interrupt and set its priority level to 4. Enable reception.
*
Example of interrupt routine processing
INTCLR Reg. Reg. XX110000 SC0CR AND 0x1C SC0BUF Clear interrupt request. Check for errors. Read received data.
if Reg. 0 then ERROR processing End of interrupt processing
Note: X = Don't care; "--" = No change
TMPR1942CY/CZ-278
TMP1942CY/CZ
(4) Mode 3 (9-bit UART mode) Setting SC0MOD0 to 11 places the device into 9-bit UART mode. In this mode a parity bit cannot be used; hence, parity should be disabled by setting SC0CR to 0. During transmission the most significant bit (the 9th bit) is written to the TB8 bit of the serial channel mode register SC0MOD0. During reception the bit is stored in the RB8 bit of the serial channel control register SC0CR. Data is always written to or read from the buffer register the most significant bit first and then the rest of the data from SC0BUF. The STOP bit length can be specified using SCnMOD2. Wake-up function In 9-bit UART mode, slave controller wake-up can be enabled by setting SC0MOD0 to 1. An INTRX0 interrupt will only be generated if RB8 = 1.
TXD
RXD
TXD
RXD
TXD
RXD
TXD
RXD
Master
Slave 1
Slave 2
Slave 3
Note: The slave controller's TXD pin must always be placed in open-drain output mode by setting the ODE register accordingly. Figure 3.11.41 Serial Link Using the Wake-Up Function
TMP1942CY/CZ-279
TMP1942 CY/CZ
Protocol 1) 2) 3) The master and slave controllers are placed in 9-bit UART mode. Each slave controller is enabled for reception by setting SC0MOD0 to 1. The master controller transmits one frame of data including the 8-bit slave controller selection code. At this point the most significant bit (bit 8: TB8) is set to 1.
start bit 0 1 2 3 4 5 6 7 8 "1" stop
Slave controller selection code
4) 5)
Each slave controller receives the above frame. The slave controller whose selection code matches the transmitted selection code clears its WU bit to 0. The master controller transmits data to the selected slave controller (the one whose SC0MOD0 bit has been cleared to 0). At this point the most significant bit (bit 8: TB8) is set to 0.
start bit 0 1 2 3 Data 4 5 6 7 bit 8 "0" stop
6)
No interrupt (INTRX0) is generated for the slave controllers whose WU bit remains 1 because the most significant bit of the received data (bit 8: RB8) = 0. These slave controllers ignore the received data. The slave controller whose WU bit has been cleared to 0 can transmit data to the master controller so as to notify the master controller that it has finished receiving. Example settings: Serial link with two slave controllers using the internal clock fsys/2 as the transfer clock
TXD
RXD Master
TXD
RXD
TXD
RXD
Slave 1 Selection code 00000001
Slave 2 Selection code 00001010
TMPR1942CY/CZ-280
TMP1942CY/CZ
* Master controller settings
Main routine 76543210 PDCR PDFC IMCCLL IMCCLH SC0MOD0 SC0BUF - - - - - - 01 - - - - - - X1 - - 110101 - - 110100 10101110 00000001 Set PD0 to TXD0 and PD1 to RXD0. Enable INTRX0 and set interrupt level to 5. Enable INTTX0 and set interrupt level to 4. Select 9-bit UART mode and set transfer clock to fsys/2. Set selection code for slave 1.
Interrupt routine (INTTX0) INTCLR SC0MOD0 SC0BUF XX110001 0- - - - - - - * * * * * * * * Clear interrupt request. Set TB8 to 0. Set transmit data.
End of interrupt processing
*
Slave settings
Main routine 76543210 PDCR PDFC ODE IMCCLL IMCCLH SC0MOD0 - - - - - - 01 - - - - - - X1 XX- - - - - 1 - - 110110 - - 110101 00111110 Select 9-bit UART mode and set transfer clock to fsys/2 and WU to 1. Enable INTTX0 and INTRX0. Set PD0 to TXD (open-drain output) and PD1 to RXD.
Interrupt routine (INTRX0) 76543210 INTCLR Reg. if Then SC0MOD0 - - - 0- - - - Clear WU to 0. XX110000 SC0BUF Clear interrupt request.
Reg. = selection code
TMP1942CY/CZ-281
TMP1942CY/CZ
3.12 Serial Bus Interface (SBI)
The TMP1942 contains one serial bus interface (SBI) channel. The serial bus interface has the following two operating modes: * * I2C bus mode (multi-master) Clock-synchronous 8-bit SIO mode
In I2C bus mode, the serial bus interface can be connected to external devices via PF4 (SDA) and PF5 (SCL). In clock-synchronous 8-bit SIO mode, it can be connected to external devices via PF3 (SCK), PF4 (SO) and PF5 (SI). The following table shows the pin settings for each mode: ODE
I C bus mode Clock-synchronous 8-bit SIO mode
2
PFCR PAFC
11X 011 010 110 111
11 XX
X: Don't care
3.12.1
Configuration
INTS2 interrupt request SCL SCK PF3 SIO Clock Control Input/ Output Control SIO data Control SO SI PF4 (SO/SDA) (SCK)
T
Divider Transfer Controller
Noise Canceller
I C Bus Clock Synchronization and Control
2
PF5 Shift Register I C Bus Data Control
2
(SI/SCL) Noise Canceller SDA
SBI0CR2/ SBI0SR SBI control register 2/SBI status register
2
I2C0AR I C bus Address Register
SBI0DBR SBI Data Buffer Register
SBI0CR1 SBI Control Register 1
SBI0BR0, 1 SBI Baud Rate Registers 0 and 1
TMP1942CY/CZ-282
TMP1942CY/CZ 3.12.2 Control
The following registers are used to control the serial bus interface and monitor its operating status: * * * * * * * Serial bus interface control register 1 (SBI0CR1) Serial bus interface control register 2 (SBI0CR2) Serial bus interface data buffer register (SBI0DBR) I2C bus address register (I2C0AR) Serial bus interface status register (SBI0SR) Serial bus interface status register 0 (SBI0BR0) Serial bus interface status register 1 (SBI0BR1)
The functions of the above registers vary according to the current operating mode of the serial bus interface. For details, refer to Section 3.12.4, "Control in I2C bus mode", and Section 3.12.7, "Control in clock-synchronous 8-bit SIO mode".
3.12.3
I2C Bus Mode Data Formats
Figure 3.12.1 shows the serial bus interface data formats used in I2C bus mode.
(a) Addressing format 8 bits S Slave address One entry 1 RA /C WK 1 to 8 bits 1 to 8 bits 1 A C Data Data K Of arbitrary length 1 A CP K
(b)
Addressing format (with restart) 8 bits S Slave address One entry 1 RA /C WK 1 to 8 bits Data Of arbitrary length 1 A CS K 8 bits Slave address One entry 1 RA /C WK 1 to 8 bits Data Of arbitrary length 1 A CP K
(c)
Free data format (format used to transfer data from master device to slave device) 8 bits S Data One entry
S: Start condition R/W: Direction bit ACK: Acknowledge bit P: Stop condition
1 A C K
1 to 8 bits Data
1 A C K
1 to 8 bits Data
1 A CP K
Of arbitrary length
Figure 3.12.1 I2C Bus Mode Data Formats
TMP1942CY/CZ-283
TMP1942CY/CZ 3.12.4 I2C Bus Mode Control Registers
When the serial bus interface is operated in I2C bus mode, the following registers are used to control the interface and to monitor its operating status: Serial Bus Interface Control Register 1 7
SBI0CR1 Bit symbol BC2 (0xFFFF_F240) Read/Write After Reset Function 0
6
BC1 W 0
5
BC0
4
ACK R/W
3
2
SCK2 W 0
1
SCK1
0
SCK0/ SWRMON
R/W 0 1
0
0
Ack clock 0: Do not generate 1: Generate
Selects number of bits to be transferred (Note 1)
Selects internal SCL output clock frequency (Note 2) and monitors reset state
Selects internal SCL output clock frequency (for write) 000 001 010 011 100 101 110 111 n=4 n=5 n=6 n=7 n=8 n=9 n=10 400 kHz 222 kHz 118 kHz 60.6 kHz 30.8 kHz 15.5 kHz 7.78 kHz reserved System clock:: fc(=32 MHz) Clock gear: : fc/1
T0 = fperiph/4 (= 8 MHz) T0 Frequency = [ Hz ] 2n + 4
Software reset state monitor (for read) 0 1 Software reset in progress Software reset not in progress
Selects number of bits to be transferred 000 001 010 011 100 101 110 111 = 0 = 1 Number of Data length Number of Data length clock cycles clock cycles 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 9 2 3 4 5 6 7 8 8 1 2 3 4 5 6 7
Note 1: Clear SBI0CR1 to 000 before switching the device to clock-synchronous 8-bit SIO mode. Note 2: For details of the SCL line clock frequency, refer to Section 3.12.5 (3), "Serial clock".
Figure 3.12.2 I2C Bus Mode Registers
TMP1942CY/CZ-284
TMP1942CY/CZ
Serial Bus Interface Control Register 2 7
SBI0CR2 Bit symbol After Reset Function MST 0 Selects master/ slave 0: Slave 1: Master (0xFFFF_F243) Read/Write 0 Selects transmit/ receive
6
TRX W
5
BB 0
4
PIN 1 Cancels INTSBI interrupt request
3
SBIM1 0 W (Note 1)
2
SBIM0 0
1
SWRST1 0 W (Note 1)
0
SWRST0 0
Start/stop generation 0: Generate stop 0: Receive state 1: Transmit 1: Generate start state
Selects serial bus interface operating mode (Note 2)
00: Port mode 0: 01: SIO mode 1: Cancel 10: I2C bus mode interrupt 11: (Reserved) request
Generates software reset A reset can be generated by writing 10 and then 01 to these bits.
Selects serial bus interface operating mode (Note 2) 00 01 10 11 Port mode (serial bus interface output disabled) Clock-synchronous 8-bit SIO mode 2 I C bus mode (Reserved)
Note 1: When read, this register functions as the SBI0SR register. Note 2: Check to see that the bus is free before switching the device to port mode. Also, check that input signals on the ports are High before switching from port mode to I2C bus mode or clock-synchronous 8-bit SIO mode. Figure 3.12.3 I2C Bus Mode Registers Table 3.12.1 Output Clock (T0) Resolutions
@fc=32 MHz
Peripheral Clock Clock Gear Value Selected Prescaler Selection Clock
00 (fc) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph) 00 (fperiph/4) 01 (fperiph/2) 10 (fperiph)
Prescaler Output Clock Resolution T0
fc/2 (0.125 s) 3 fc/2 (0.25 s) 4 fc/2 (0.5 s) 5 fc/2 (1.0 s) 2 fc/2 (0.25 s)
2
01 (fc/2) 0 (fgear) 10 (fc/4)
11 (fc/8)
00 (fc)
01 (fc/2) 1 (fc) 10 (fc/4)
11 (fc/8)
Note:
The - character means "Don't use".
TMP1942CY/CZ-285
TMP1942CY/CZ
Serial Bus Interface Status Register 7
Bit symbol SBI0CR (0xFFFF_F243) Read/Write After Reset Function MST 0 Master/ slave selection 0: Slave 1: Master
6
TRX 0 Transmit/r eceive selection
5
BB 0
4
PIN R 1 INTS2 interrupt request status
0: Interrupt request generated 1: Interrupt request cancelled
3
AL 0 Arbitration lost detection
2
AAS 0
1
AD0 0 General call detection
0
LRB 0 Last received bit
I2C bus status 0: Bus free 0: Receive 1: Bus busy 1: Transmit
Slave address match detection 0: 1: Detected 0: 1: Detected
0: 0 0: 1: Detected 1: 1
Last received bit 0 1 Last bit received was 0 Last bit received was 1 Matching slave address or general call has been detected Arbitration lost has been detected
Slave address match detection 0 1
Arbitration lost detection 0 1
Note: When written, this register functions as the SBI0CR2 register. Figure 3.12.4 I2C Bus Mode Registers
TMP1942CY/CZ-286
TMP1942CY/CZ
Serial Bus Interface Baud Rate Register 0 7
Bit symbol SBI0BR0 (0xFFFF_F244) Read/Write After Reset Function
6
I2SBI0 R/W 0 IDLE 0: Idle 1: Operate
5

4

3

2

1

0
W Must always be set to 0.
Operation in IDLE mode 0 1 Idle Operate
Serial Bus Interface Baud Rate Register 1 7
Bit symbol SBI0BR1 (0xFFFF_F245) Read/Write After Reset Function P4EN R/W 0 Internal clock 0: Stopped 1: Operate Operation in IDLE mode 0 1 Idle Operate
6

5

4

3

2

1

0
W
Serial Bus Interface Baud Rate Register 7
Bit symbol SBI0DBR (0xFFFF_F241) Read/Write After Reset DB7
6
DB6
5
DB5
4
DB4
3
DB3
2
DB2
1
DB1
0
DB0
R (receive)/W (transmit) Undefined
Note: When writing transmit data, make sure that the data is MSB-justified (bit 7 is the MSB). I2C Bus Address Register 7
Bit symbol (0xFFFF_F242) Read/Write SBI0BR1 After Reset Function SA6 0
6
SA5 0
5
SA4 0
4
SA3 W 0
3
SA2 0
2
SA1 0
1
SA0 0
0
ALS 0 Specifies address recognition mode
Specifies slave address when device is operating as slave device
Operation in IDLE mode 0 1 Idle Operate
Figure 3.12.5 I2C Bus Mode Registers
TMP1942CY/CZ-287
TMP1942CY/CZ 3.12.5 Control in I2C Bus Mode
(1) Specifying acknowledgment mode Setting SBI0CR1 to 1 causes the serial bus interface to operate in acknowledgment mode. When operating as the master device, the device allows one extra clock cycle for an acknowledge signal. In transmitter mode, the device releases the SDA pin during this clock cycle so that it can receive an acknowledge signal from the receiver. In receiver mode, the device pulls the SDA pin Low during this clock cycle, thus generating an acknowledge signal. Setting SBI0CR1 to 0 causes the serial bus interface to operate in non-acknowledgment mode, in which case the device will not generate an extra clock cycle for an acknowledge signal. (2) Selecting the number of bits to be transferred SBI0CR1 can be used to specify the number of bits in the next data item to be transmitted or received. Since the BC2:BC0 bits are cleared to 000 as a start condition, the slave address and direction bit are always transferred as eight bits. In all other cases, the BC2:BC0 bits hold the value which has been set. (3) Serial clock 1) Clock source The SBI0CR1 bits are used to select the maximum transfer frequency of the serial clock which is output on the SCL pin in master mode.
tHIGH tLOW 1/fscl
SBI0CR1 tLOW = 2 /T0 tHIGH = 2 /T0 + 4/T0 fscl = 1/(tLow + tHIGH) T0 = 2n + 4
n n
n 4 5 6 7 8 9 10
000 001 010 011 100 101 110
Figure 3.12.6 Clock Source
TMP1942CY/CZ-288
TMP1942CY/CZ
2) Clock synchronization In I2C bus mode, a master device which first pulls the clock line Low will disable the clocks of other master devices which are outputting a High clock pulse, thus implementing wired-AND bus configuration. Therefore, any master which is outputting a High clock pulse must detect the situation and take appropriate action. Since the serial bus interface has a clock synchronization function, transfers are always performed correctly even when multiple master devices are present on the bus. The clock synchronization procedure is described below using an example in which there are two masters on the bus.
Wait for High-level period counting Start High-level period counting Internal SCL output (master A) Internal SCL output (master B) SCL line a b c Reset High-level period count
Figure 3.12.7 Clock Synchronization Example Master A pulls the internal SCL output Low at point 'a' so that the bus SCL line goes Low. Master B detects this and resets its High-level period count before pulling its internal SCL output Low. Master A finishes Low-level period counting at point 'b', releasing its internal SCL output back High. However, since master B is still holding the SCL line Low, master A does not start High-level period counting. At point "c", when master B has released its internal SCL output back High and the bus SCL line goes High, master A detects these conditions and starts High-level period counting. Thus, the bus clock frequency is determined by the master connected to the bus which has the shortest High-level period and the master connected to the bus which has the longest Low-level period. (4) Setting the slave address and selecting address recognition mode To operate the device as a slave device, set the slave address in I2C0AR and . Setting ALS to 0 selects address recognition mode. (5) Specifying a master or slave Setting SBI0CR2 to 1 causes the device to operate as a master device. Setting SBI0CR2 to 0 causes the device to operate as a slave device. If a stop condition or arbitration lost is detected on the bus, SBI0CR2 is automatically cleared to 0 by hardware.
TMP1942CY/CZ-289
TMP1942CY/CZ
(6) Selecting a transmitter or receiver Setting SBI0CR2 to 1 causes the device to operate as a transmitter. Setting SBI0CR2 to 0 causes the device to operate as a receiver. In slave mode, * * * when transferring data in addressing format when the received slave address is the same as the value set in I2C0AR when a general call (all 8 bits of data after a start condition are 0) is received
TRX is set to 1 by hardware when the direction bit ( R / W ) sent from the master device is 1 or set to 0 when the direction bit is 0. In master mode, when acknowledgement is returned from a slave device, TRX changes to 0 by hardware if the transmitted direction bit is 1 or changes to 1 if the transmitted direction bit is 0. When no acknowledgement is returned, TRX remains unchanged. If a stop condition or arbitration lost is detected on the bus, SBI0CR2 is automatically cleared to 0 by hardware. (7) Generating a start/stop condition When SBI0SR = 0, writing 1s to SBI0CR2 causes a start condition and 8-bit data to appear on the bus. Ensure that SBI0CR1 has been set to 1 beforehand.
SCL Line SDA Line Start Condition 1 2 3 4 5 6 7 8 9
A6
A5
A4
A3
A2
A1
A0
R/W Acknowledge signal
Slave address and direction bit
Figure 3.12.8 Generating a Start Condition and Slave Address When BB = 1, writing 1s to SBI0CR2 and a 0 to SBI0CR2 initiates a stop condition output sequence on the bus. Do not change the contents of SBI0CR2 until a stop condition has been generated on the bus.
SCL Line SDA Line Stop Condition
Figure 3.12.9 Generating a Stop Condition The bus status can be determined by reading SBI0SR. SBI0SR is set to 1 (bus busy state) upon the detection of a start condition on the bus or reset to 0 (bus free state) upon the detection of a stop condition.
TMP1942CY/CZ-290
TMP1942CY/CZ
(8) Requesting interrupt service and canceling requests When a serial bus interface interrupt request (INTS2) occurs, SBI0CR2 is reset to 0. The SCL line is held Low while SBI0CR2 = 0. PIN is reset to 0 when the device has finished transmitting or receiving one word of data, and set to 1 when data is written to or read from SBI0DBR. There is a delay of tLOW between PIN being set to 1 and the SCL line being released. In address recognition mode (i.e. when I2C0CR = 0), PIN is reset to 0 when the slave address received matches the value set in I2C0AR or when a general call is received (i.e. when the eight data bits after the start condition are all 0). Writing a 1 to SBI0CR2 in the program sets it to 1; however, writing a 0 to PIN does not clear it to 0. (9) Serial bus interface operating mode The SBI0CR2 bits are used to set the operating mode of the serial bus interface. To use the serial bus interface in I2C bus mode, set SBI0CR2 to 10. Ensure that the bus is free before switching from this mode to port mode. (10) Monitoring detection of arbitration lost Since multi-master operation is possible in I2C bus mode (i.e. two or more masters may exist on the bus simultaneously), a procedure for arbitrating among masters contending for bus control is needed in order to guarantee the integrity of data being transferred. Any attempt to generate a start condition in the bus busy state will result in "arbitration lost"; data is not output on the SCL or SDA line. The data on the SDA line is used for bus arbitration in I2C bus mode. The arbitration procedure is described below using an example in which two masters are residing on the bus simultaneously. Masters A and B output the same data until the bit at point "a", at which point master A outputs a Low signal and master B a High signal. Since the SDA line of the bus has wired-AND configuration, it is pulled Low by master A. When the SCL line goes High at point "b", the slave device latches the SDA line data (i.e. the data output by master A). The data output by master B at this time has no effect and is ignored. This condition of master B is referred to as "arbitration lost". Master B releases the SDA pin so that it will not affect data output by other masters. If more than one master transmits the same first data word, the arbitration procedure will be continued on the next and subsequent words.
SCL Line Internal SDA Output (Master A) Internal SDA Output (Master B) SDA Line a b Arbitration is lost and the internal SDA output is driven High
Figure 3.12.10 Arbitration Lost
TMP1942CY/CZ-291
TMP1942CY/CZ
The internal SDA output level for each master is compared with the level of the bus SDA line at the rising edge of the SCL clock. If the levels do not match, it is assumed that arbitration is lost and SBI0SR will be set to 1. At this point the SBI0SR bits are reset to 00, thus placing the master into slave receiver mode. SBI0SR is cleared to 0 by writing data to or reading data from SBI0DBR, or by writing data to SBI0CR2.
Internal SCL Output Internal SDA Output Internal SCL Output Internal SDA Output 1 2 3 4 5 6 7 8 9 1 2 3 4
Master A
D7A
D6A
D5A
D4A
D3A
D2A
D1A
D0A
D7A' D6A' D5A' D4A'
Clock output stops here. 1 2 3 4
Master B
D7B
D6B
Internal SCL output Internal SDA output


Access to SBI0DBR or SBI0CR2
Figure 3.12.11 Example for Master B (D7A = D7B, D6A = D6B) (11) Monitoring detection of a slave address match If the device is operating as a slave device in address recognition mode (I2C0AR = 0) and receives a general call or a slave address of the same value as that set in I2C0AR, SBI0SR will be set to 1. If I2C0AR = 1, SBI0SR will be set to 1 upon the reception of the first word. The AAS flag is cleared to 0 by writing data to or reading data from SBI0DBR. (12) Monitoring detection of a general call SBI0SR is set to 1 when a general call is received (i.e. when the eight data bits after the start condition are all 0) in slave mode, and is reset to 0 when a start or stop condition is detected on the bus. (13) Monitoring the last bit received SBI0SR holds the value of the SDA line which is latched at the rising edge of the SCL clock. In acknowledgment mode, the value read from SBI0SR immediately after an INTS2 interrupt request has been generated is equivalent to the value of the ACK signal.
TMP1942CY/CZ-292
TMP1942CY/CZ
(14) Software reset If the serial bus interface circuit locks due to noise from external sources, it can be initialized using the software reset function. Writing 10 and then 01 to SBI0CR2 causes a reset signal pulse to be applied to the serial bus interface circuit, initializing it. All control registers and status flags are initialized to their reset values. SBI0CR2 are automatically cleared to 00 upon the initialization of the serial bus interface.
Note: A software reset also resets the selection of the operating mode, causing a transition from I2C bus mode to clock-synchronous 8-bit SIO mode. (15) Serial bus interface data buffer register (SBI0DBR) Reading received data from and writing transmit data to the serial bus interface circuit are accomplished by reading from and writing to SBI0DBR. In addition, in master mode the slave address and the direction bit are set in this register, after which a start condition is generated. (16) I2C bus address register (I2C0AR) When the device is operating as a slave device, the I2C0AR bits are used to set the slave address. In addition, when I2C0AR = 0, the device recognizes the slave address output by the master device, and data is sent in addressing format. When I2C0AR = 1, the device will not recognize the slave address output by the master device, and data will be sent in free format. (17) Baud rate register (SBI0BR1) Before the I2C bus can be used, the P4EN bit of the baud rate circuit control register (SBI0BR1) must be set to 1. (18) IDLE2 setting register (SBI0BR0) The SBI0BR0 bit enables or disables device operation after the device has entered IDLE mode. This bit must be set before the instruction to enter standby mode is executed.
TMP1942CY/CZ-293
TMP1942CY/CZ 3.12.6 Data Transfer Procedure in I2C Bus Mode
(1) Initializing the device First, set SBI0BR1 and SBI0CR1. Set SBI0BR1 to 1 and clear bits 7-5 and 3 of SBI0CR1 to 0. Next, set the slave address in I2C0AR and set I2C0AR to 0 for addressing format. Then, to initialize the device to slave receiver mode, set SBI0CR2 to 000, SBI0CR2 to 1, SBI0CR2 to 10 and clear bits 1 and 0 of SBI0CR2 to 00.
76543210
SBI0BR1 1 0 0 0 0 0 0 0 SBI0CR1 0 0 0 X 0 X X X I2C0AR
Operate internal baud rate generator. Set ACK and SCL clocks. Set slave address and address recognition mode. Select slave receiver mode.
XXXXXXXX
SBI0CR2 0 0 0 1 1 0 0 0
(Note) X: Don't care
(2) Generating a start condition and slave address 1) In master mode Follow the procedure described below to generate a start condition and slave address in master mode: First, check that the bus is free (SBI0SR = 0). Next, place the serial bus into acknowledgment mode by setting SBI0CR1 to 1. Also, write the slave address and direction bit to SBI0DBR. While SBI0SR = 0, set SBI0CR2 to 1111 to generate a start condition on the bus. Then output nine clock pulses on the SCL pin. For the first eight clock pulses, output the slave address and direction bit which have been set in SBI0DBR. Release the SDA line on the ninth clock pulse to receive an acknowledge signal from the slave device. An INTS2 interrupt request is generated at the falling edge of the ninth clock pulse, resetting SBI0CR2 to 0. In master mode, the SCL line is held Low while PIN = 0. In addition, only when an acknowledge signal is returned from the slave device, the generation of an INTS2 interrupt request causes SBI0CR2 to change state according to the transmitted direction bit. Settings in the main routine
76543210
Reg. Reg. Then SBI0CR1 X X X 1 0 X X X SBI0DR1 X X X X X X X X SBI0CR2 1 1 1 1 1 0 0 0
SBI0SR Reg. e 0x20 Check that bus is free. Select acknowledgement mode. Set slave address and direction for target slave. Generate start condition.
if Reg. 0x00
Example of INTS2 interrupt routine processing
0X34 INTCLR Processing End of interrupt processing Clear interrupt request.
TMP1942CY/CZ-294
TMP1942CY/CZ
2) In slave mode In slave mode a start condition and slave address are received. The slave address and the direction bit are received from the master device with the first eight clock pulses on the SCL line after the start condition. The start condition is also received from the master device. When a general call or an address identical to the slave address which has been set in I2C0AR is received, the SDA line is pulled Low on the ninth clock pulse to output an acknowledge signal. An INTS2 interrupt request is generated at the falling edge of the ninth clock pulse, resetting SBI0CR2 to 0. In slave mode, the SCL line is held Low while PIN = 0. Note: DMA transfer can be used only when the following conditions are satisfied: - A single master corresponds to a single slave. - Continuous transmission or reception is possible.
1 2 3 4 5 6 7 8 9
SCL
SDA
A6
A5
A4
A3
A2
A1
A0
R/ W
ACK Ack from slave
Start condition INTS2 Interrupt Request
Slave address + direction bit
Master output Slave output
Figure 3.12.12 Generating a Start Condition and Slave Address (3) Transferring one word of data During the INTS2 interrupt processing which takes place after the device has finished transferring one word of data, SBI0SR is tested to determine whether the device is placed in master mode or slave mode. 1) In master mode (when SBI0SR = 1) SBI0SR is tested to determine whether the device is a transmitter or a receiver. In transmitter mode (when SBI0SR = 1) SBI0SR is tested. If SBI0SR = 1, the receiver is not requesting data; therefore, a sequence for generating a stop condition (described later) should be performed to terminate the data transfer. If SBI0SR = 0, the receiver is requesting the next data item. If the next data item to be transferred is 8 bits long, write the transfer data to SBI0DBR. If it is not 8 bits long, set SBI0CR1 and SBI0CR1 before writing the transfer data to SBI0DBR. When data is written to the data buffer register, SBI0CR2 is set to 1, the serial clock for transferring the next word of data is generated from the input on the SCL pin, and one word of data is output on the SDA pin. When the device has finished transferring data, an INTS2 interrupt request is generated, SBI0CR2 is reset to 0 and the SCL pin is pulled Low. To transfer more than one word, repeat the above procedure starting from the test of SBI0SR.
TMP1942CY/CZ-295
TMP1942CY/CZ
INTS2 interrupt
if MST = 0 Then go to slave mode processing if TRX = 0 Then go to receiver mode processing if LRB = 0 Then go to processing for generating stop condition
SBI0CR1 X X X X 0 X X X SBI0DBR X X X X X X X X
Set number of bits to be transferred and ACK. Write transfer data.
End of interrupt processing Note: X: Don't care
SCL pin Write to SBI0DBR SDA pin
1
2
3
4
5
6
7
8
9
D7
D6
D5
D4
D3
D2
D1
D0
ACK Ack signal from receiver

INTS2 Interrupt Request Master output Slave output
Figure 3.12.13 Example in Which SBI0CR1 = 000 and SBI0CR1 = 1 (Transmitter Mode) In receiver mode (when SBI0SR = 0) If the next data item to be transferred is 8 bits long, write the transfer data to SBI0DBR. If it is not 8 bits long, set SBI0CR1 and SBI0CR1 and then read the received data from SBI0DBR in order to release the SCL line. (The data read out immediately after the transmission of the slave address is undefined.) When data is read from the data buffer register, SBI0CR2 is set to 1. The serial clock for transferring the next word of data is output on the SCL pin. The SDA pin is pulled Low at the final bit when the acknowledge signal goes Low. An INTS2 interrupt request is now generated, SBI0CR2 is reset to 0 and the SCL pin is pulled Low. Each time received data is read from SBI0DBR, a clock pulse for one-word data transfer and an acknowledge signal are output.
Read received data SCL 1 2 3 4 5 6 7 8 9
SDA
D7
D6
D5
D4
D3
D2
D1
D0
ACK
Next D7 Ack signal to transmitter
INTS2 Interrupt Request Master output Slave output
Figure 3.12.14 Example in Which SBI0CR1 = 000 and SBI0CR1 = 1 (Receiver Mode)
TMP1942CY/CZ-296
TMP1942CY/CZ
To instruct the transmitter to terminate data transmission, set SBI0CR1 to 0 before reading the data which is one word before the last data to be received. This disables generation of an acknowledge clock pulse for the last data. As part of the processing after the generation of an end-of-transfer interrupt request, set SBI0CR1 to 001 and read out data, at which time a clock pulse for one-bit data transfer is generated. Since the master at this time is a receiver, it will hold the bus SDA line High. The transmitter receives this High-level signal as an ACK signal, so that the receiver can request the transmitter to terminate transmission. As part of the processing after the interrupt request generated upon the completion of receiving this one bit, generate a stop condition to terminate data transfer.
SCL 9 1 2 3 4 5 6 7 8 1
SDA
D7
D6
D5
D4
D3
D2
D1
D0
Ack signal (High) to transmitter

INTS2 Interrupt Request After clearing SBI0CR1 to 0, read received data. After setting SBI0CR1 to 001, read received data. Master output Slave output
Figure 3.12.15 Terminating Data Transmission in Master Receiver Mode Example: When receiving data N times INTS2 interrupt (after transmitting data)
76543210
SBI0CR1 X X X X 0 X X X Reg.
Set number of bits received and ACK. Read dummy data.
SBI0CBR End of interrupt
INTS2 interrupt (first to (N-2)th data reception)
76543210
Reg.
SBI0DBR End of interrupt
Read first to (N-2)th received data.
INTS2 interrupt ((N-1)th data reception)
76543210
SBI0CR1 X X X 0 0 X X X Reg.
Disable generation of clock for acknowledge signal. Read (N-1)th received data.
SBI0DBR End of interrupt
INTS2 interrupt (Nth data reception)
76543210
SBI0CR1 0 0 1 0 0 X X X Reg.
Generate clock for 1-bit transfer. Read Nth received data.
SBI0DBR
End of interrupt
INTS2 interrupt (after receiving data)
Processing for generating stop condition End of interrupt Note: X: Don't care Terminate data transfer.
TMP1942CY/CZ-297
TMP1942CY/CZ
2)
In slave mode (SBI0SR = 0) In slave mode, an INTS2 interrupt request is generated when a slave address or general call sent by the master is received, or when the data transfer is completed after a general call is received or the received slave address is found to match the device's address. Also, if the arbitration-lost condition is detected in master mode, the device will operate in slave mode, in which case an INTS2 interrupt request will be generated when the device has finished transferring the word in which the arbitration-lost condition was detected. When an INTS2 interrupt request occurs, SBI0CR2 is set to 0 and the SCL pin is pulled Low. The SCL pin is released tLOW after data is written to or read from SBI0DBR, or tLOW after SBI0CR2 is set to 1. In slave mode, perform the processing which normally needs to be performed in slave mode or any processing which needs to be performed after the device has entered slave mode upon detecting the arbitration-lost condition. In each case, test SBI0SR to determine the necessary processing. Table 3.12.1 shows the various slave mode statuses and the necessary processing for each.
Example: When the slave address is matched and the direction bit is 1 in slave receiver mode INTS2 interrupt
if TRX = 0 Then go to other processing if AL = 1 Then go to other processing if AAS = 0 Then go to other processing
SBI0CR1 X X X 1 0 X X X SBI0DBR X X X X 0 X X X
Set number of bits to be transmitted. Set transmit data.
Note: X: Don't care
TMP1942CY/CZ-298
TMP1942CY/CZ
Table 3.12.2 Processing in Slave Mode
1

1

1 0
Status
The arbitration-lost condition was detected while the slave address was being sent and the device received a slave address sent by another master for which the direction bit was 1. In slave receiver mode, the device received a slave address sent by another master for which the direction bit was 1. The device has finished sending one data word in slave transmitter mode.
Processing
Set SBI0CR1 to the number of bits in one word and write the data to be transmitted to SBI0DBR.
0
1
0
0
0
Test SBI0SR. If it is set to 1, indicating that the receiver is not requesting the next data item, set SBI0CR2 to 1 and reset to 0 to release the bus. If SBI0SR = 0, indicating that the receiver is requesting the next data item, set SBI0CR1 to the number of bits in one word and write the data to be transmitted to SBI0DBR. Read SBI0DBR to set SBI0CR2 to 1 (a dummy read), or set it by writing a 1 to it.
0
1
1
1/0
The arbitration-lost condition was detected while the slave address was being sent and the device received either a slave address sent by another master for which the direction bit was 0 or a general call. The arbitration-lost condition was detected while the slave address or data was being sent and the device finished sending the word. In slave receiver mode, the device received either a slave address sent by another master for which the direction bit was 0 or a general call. In slave receiver mode, the device has finished receiving one word of data.
0
0
0
1
1/0
0
1/0
Set SBI0CR1 to the number of bits in one word and read the received data from SBI0DBR.
TMP1942CY/CZ-299
TMP1942CY/CZ
(4) Generating a stop condition If SBI0SR = 1, set SBI0CR2 to 111 and reset SBI0CR2 to 0. The device starts a sequence for outputting a stop condition to the bus. Do not rewrite the contents of SBI0CR2 until the stop condition appears on the bus. Note, however, that if the bus SCL line has been pulled Low by some other device, the device will wait until the SCL line is released High again; when SCL is High again, the device will drive the SDA pin High, thereby generating a stop condition.
76543210
SBI0CR2 1 1 0 1 1 0 0 0
Generate stop condition.
"1" "1" "0" "1" SCL pin SDA pin
Stop condition
(read)
Figure 3.12.16 Generating a Stop Condition
TMP1942CY/CZ-300
TMP1942CY/CZ
(5) Restart procedure Restart is used by a master device to change the direction of transfer with respect to a slave device without terminating data transfer. The following shows how to trigger a restart when the device is operating in master mode. First, reset SBI0CR2 to 000 and set SBI0CR2 to 1 to release the bus. Since at this time the SDA pin is held High and the SCL pin is released, no stop condition is generated on the bus, with the result that the bus appears to other masters to be in busy state still. Then, test SBI0SR and wait until it becomes 0, confirming that the SCL pin has been released. Next, test SBI0SR and wait until it becomes 1, confirming that no other device is pulling the bus SCL line Low. After using the above procedures to confirm that the bus is free, generate a start condition by following the procedure described earlier in (2). Note, however, that in order to yield the necessary restart set-up time, a wait time of at least 4.7 s must be generated by software between the bus free state being confirmed and a start condition being generated.
76543210 SBI0CR2 0 0 0 1 1 0 0 0
if SBI0SR 0 Then if SBI0SR 1 Then 4.7 s Wait
SBI0CR1 X X X 1 0 X X X SBI0DBR X X X X X X X X SBI0CR2 1 1 1 1 1 0 0 0
Release bus. Check that SCL pin is released. Check that no other device is pulling SCL line Low.
Select acknowledgement mode. Set slave address and direction for target slave. Generate start condition.
Note: X: Don't care
"0" "0" "0" "1"
"1" "1" "1" "1" 4.7 s (min.) Start condition
SCL (bus) SCL pin SDA pin 9

Figure 3.12.17 Restart Generation Timing
Note : Please do not carry out the light of ="0" in the state of ="0" (it cannot re-start).
TMP1942CY/CZ-301
TMP1942CY/CZ 3.12.7 Control in clock-synchronous 8-bit SIO mode
The following section describes the registers which are used to control the serial bus interface and to monitor its operating status when it is used in clock-synchronous 8-bit SIO mode Serial Bus Interface Baud Rate Register 0 7
Bit symbol SBI0CR1 (0xFFFF_F240) Read/Write After Reset Function SIOS 0 Indicate transfer start/stop 0: Stop 1: Start
6
SIOINH W 0 Continue/ abort transfer
5
SIOM1 0 Transfer mode selection
4
SIOM0 0
3

2
SCK2 W 0
1
SCK1 0
0
SCK0 R/W 1
Selects serial clock frequency and monitors reset state
00: Transmit mode 0: Continue 01: (Reserved) transfer 10: Transmit/receive 1: Abort mode transfer 11: Receive mode
Selects serial clock frequency (for write) 000 001 010 011 100 101 110 111 n=3 n=4 n=5 n=6 n=7 n=8 n=9 1.25 625 312.5 156.3 78.13 39.06 19.53 kHz kHz kHz kHz kHz kHz kHz System clock:: fc(=40 MHz) Clock gear: : fc/1 T0 = fperiph/4 (= 10 MHz) T0 Frequency = [ Hz ] 2n
External clock
Note:
Set SBI0CR1 to 0 and SBI0CR1 to 1 before setting the transfer mode and the serial clock frequency.
Serial Bus Interface Data Buffer Register 7
Bit symbol SBI0DBR (0xFFFF_F241) Read/Write After Reset DB7
6
DB6
5
DB5
4
DB4
3
DB3
2
DB2
1
DB1
0
DB0
R (receive)/W (transmit) Undefined
Figure 3.12.18 SIO Mode Registers
TMP1942CY/CZ-302
TMP1942CY/CZ
Serial Bus Interface Control Register 2 7
SBI0CR2 Bit symbol After Reset Function (0xFFFF_F243) Read/Write
6

5

4

3
SBIM1 W 0
2
SBIM0 0
1

0

Selects serial bus interface operating mode 00: Port mode 01: Clock-synchronous 8-bit SIO mode 2 10: I C bus mode 11: (Reserved)
Selects Serial Bus Interface Operating Mode 7
SBI0SR Bit symbol After Reset Function (0xFFFF_F243) Read/Write
6

5

4

3
SIOF R 0
Serial transfer operation status 0: Transfer terminated
2
SEF 0
Shift operation status 0: Shift operation terminated
1

0

1: Transfer in 1: Shift operation progress in progress
Serial Bus Interface Baud Rate Register 0 7
Bit symbol SBI0BR0 (0xFFFF_F244) Read/Write After Reset Function
6
I2SBI0 R/W 0 IDLE 0: Idle 1: Operate
5

4

3

2

1

0
W Must always be set to 0.
Serial Bus Interface Baud Rate Register 1 7
Bit symbol SBI0BR1 (0xFFFF_F245) Read/Write After Reset Function P4EN R/W 0 Internal clock 0: Stopped 1: Operate
6

5

4

3

2

1

0

Figure 3.12.19 SIO Mode Registers
TMP1942CY/CZ-303
TMP1942CY/CZ
(1) Serial clock 1) Clock source Clock sources can be selected using SBI0CR1 as described below. Internal clock In internal clock mode, one of seven clock source frequencies can be selected. The serial clock is output to external devices on the SCK pin. Note that when a transfer starts, the SCK pin is driven High. The device has an automatic wait function which works as follows: if an operation to write data (during transmission) or read data (during reception) in a program cannot keep up with the serial clock rate, the device will automatically stop the serial clock and suspend the next shift operation until reading or writing has been completed.
Automatic Wait SCK Pin Output 1 2 3 7 8 1 2 6 7 8 1 2 3
SO Pin Output Write Transmit Data
a0 a
a1
a2 a5 a6
a7
b0 b
b1 c
b4 b5
b6
b7
c0
c1
c2
Figure 3.12.20 Automatic Wait Function
External clock (SBI0CR1 = 111) A clock signal from an external source input via the SCK pin can be used as the serial clock. To ensure that shift operations will be performed without fail, the High-level and the Low-level durations of the serial clock must satisfy the pulse width conditions given below.
SCK Pin
tSCKL tSCKH tSCKL, tSCKH > 8/fsys
Figure 3.12.21 Maximum Transfer Frequency for External Clock Input
TMP1942CY/CZ-304
TMP1942CY/CZ
2) Edges used for shifting During transmission data is shifted at the leading edge; during reception data is shifted at the trailing edge. Leading-edge shift Data is shifted at the leading edge of the serial clock (the falling edge of the SCK pin input/output). Trailing-edge shift Data is shifted at the trailing edge of the serial clock (the rising edge of the SCK pin input/output).
SCK pin
SO pin
bit 0
bit 1
bit 2
bit 3
bit 4
bit 5
bit 6
bit 7
Shift Register
76543210 *7654321 **765432
***76543
****7654
*****765
******76
******7
(a) Leading-edge shift
SCK pin
SO pin
bit 0
bit 1
bit 2
bit 3
bit 4
bit 5
bit 6
bit 7
Shift Register
********
0*******
10******
210*****
3210****
43210***
543210** 6543210* 76543210
(b) Trailing-edge shift
Note: * = Don't care
Figure 3.12.22 Edges Used for Shifting
TMP1942CY/CZ-305
TMP1942CY/CZ
(2) Transfer mode SBI0CR1 is used to select the mode of transfer among transmit mode, receive mode and transmit/receive mode. 1) 8-bit transmit mode After selecting transmit mode in the control register, write transmit data to SBI0DBR. Transmission is initiated by setting SBI0CR1 to 1 after writing transmit data to the data buffer register. The transmit data is transferred from SBI0DBR to the shift register, from which the data is shifted out to the SO pin synchronously with the serial clock, starting with the least significant bit (LSB). Once the transmit data has been transferred from SBI0DBR to the shift register, SBI0DBR becomes empty and generates an INTSBI (buffer empty) interrupt request to request the next transmit data. If an internal clock is being used, unless the next data item has been set in the data buffer register after the transmission of all 8 bits of data, the device will automatically stop the serial clock and suspend processing. The automatic wait is released when the next transmit data is written into the data buffer register. If an external clock is being used, data must be written into SBI0DBR before the next data item can be shifted. The transfer rate thus depends on the maximum delay between an interrupt request being generated and data being written into SBI0DBR by an interrupt service routine. When transmission is started, after the SBI0SR goes High, the SO pin outputs the final bit of the last transferred data until the falling edge of SCK. To terminate transmission write a 0 to SBI0CR1 or a 1 to SBI0CR1 in the interrupt service routine for the INTS2 interrupt. Once SBI0CR1 has been cleared, transmission will be terminated when all the data has been output. Check SBI0SR in the program to determine whether transmission has been terminated. SBI0SR is reset to 0 upon the termination of transmission. If SBI0CR1 has been set to 1, transmission will be aborted immediately and SBI0SR cleared to 0. Furthermore, if an external clock is being used, SBI0CR1 must be cleared to 0 before the device can start shifting out the next transmit data. Unless SBI0CR1 has been cleared to 0 before the device shifts out the data, dummy data will be transmitted and transmit operation ends.
76543210
SBI0CR1 0 1 0 0 0 X X X SBI0DBR X X X X X X X X SBI0CR1 1 0 0 0 0 X X X
Select transmit mode. Write transmit data. Start transmission.
INTS2 interrupt
SBI0DBR X X X X X X X X
Write transmit data.
TMP1942CY/CZ-306
TMP1942CY/CZ
Clear SIOS SCK pin (output) SO pin INTS2 Interrupt Request SBI0DBR a b (a) Internal clock Write transmit data
*
a0
a1
a2
a3
a4
a5
a6
a7
b0
b1
b2
b3
b4
b5
b6
b7
Clear SIOS SCK pin (input) SO pin INTS2 Interrupt Request
*
a0
a1
a2
a3
a4
a5
a6
a7
b0
b1
b2
b3
b4
b5
b6
b7
SBI0DBR
a
b (b) External clock
Write transmit data
Figure 3.12.23 Transmit Mode
Example: Sample program (MIPS16) that instructs external clock) ADDIU r3, r0, 0x04 STEST1 : LB r2, (SBI0SR) AND r2, r3 BNEZ r2, STEST1 ADDIU r3, r0, 0x20 STEST2 : LB r2, (PA) AND r2, r3 BEQZ r2, STEST2 ADDIU r3, r0, 0y00000111 STB r3, (SBI0CR1)
termination of SIO transmission (with
; If SBI0SR = 1 then loop
; If SCK = 0 then loop
; 0
TMP1942CY/CZ-307
TMP1942CY/CZ
SCK pin SIOF SO pin bit 6 bit 7 tSODH = Min. 3.5/fsys/2 [s]
Figure 3.12.24 Transmit Data Retention Time When Terminating Transmission
2)
8-bit receive mode After selecting receive mode in the control register, write a 1 to SBI0CR1, enabling the device to receive data. Data is read into the shift register from the SI pin synchronously with the serial clock, beginning with the least significant bit. When 8 bits of data have been read, the received data is transferred from the shift register to SBI0DBR and an INTS2 (buffer full) interrupt request is generated, requesting that the received data be read out. The received data is read out from SBI0DBR by an interrupt service routine. If an internal clock is being used, the automatic wait function is activated, halting the serial clock until the receive data is read out from SBI0DBR. If an external clock is being used, shift operation is synchronized to the externally sourced clock. The maximum transfer rate for external clock operation thus depends on the maximum delay between an interrupt request being generated and the received data being read out. To terminate reception write a 0 to SBI0CR1 or a 1 to SBI0CR1 in the interrupt service routine for the INTS2 interrupt. Once SBI0CR1 has been cleared, reception will be terminated when all the received data bits have been written into SBI0DBR. Check SBI0SR in the program to determine whether reception has been terminated. SBI0SR is reset to 0 upon the termination of reception. After confirming that reception has been terminated, read out the last data item received. If SBI0CR1 has been set to 1, reception will be aborted immediately and SBI0SR cleared to 0. (In that case, the received data is invalid and need not be read out.)
Note: If the transfer mode is changed during receive operation, the contents of SBI0DBR will be lost. If it is necessary to change the transfer mode, first terminate reception (by writing a 0 to SBI0CR1) and read out the last data received.
76543210
SBI0CR1 0 1 1 1 0 X X X SBI0CR1 1 0 1 1 0 0 0 0
Select receive mode. Start reception.
INTS2 interrupt
Reg.
SBIODBR
Read received data.
TMP1942CY/CZ-308
TMP1942CY/CZ
Clear SIOS SCK pin (output) SI pin INTS2 Interrupt Request SBI0DBR a Read received data b Read received data a0 a1 a2 a3 a4 a5 a6 a7 b0 b1 b2 b3 b4 b5 b6 b7
Figure 3.12.25 Receive Mode (example with internal clock) 3) 8-bit transmit/receive mode After selecting transmit/receive mode in the control register, write the transmit data to SBI0DBR. Then set SBI0CR1 to 1, enabling the device to transmit/receive data. Transmit data is output on the SO pin at the falling edge of the serial clock starting with the least significant bit, while the received data is read into the shift register from the SI pin at the rising edge of the serial clock. When 8 bits of data have been read, the received data is transferred from the shift register to SBI0DBR and an INTS2 interrupt request is generated. Use an interrupt service routine to read out the received data from the data buffer register, then write transmit data to the data buffer register. Since SBI0DBR is shared for transmission and reception, always be sure to read out the received data before writing transmit data to the data buffer register. If an internal clock is being used, the automatic wait function is activated, halting the serial clock until the received data has been read out and the next transmit data has been written into the data buffer register. If an external clock is being used, since shift operation is synchronized to the externally sourced clock, the received data must be read out and the next transmit data written into the data buffer register before the next shift operation can start. The maximum transfer rate for external clock operation thus depends on the maximum delay between an interrupt request being generated and the received data being read out. When transmission is started, after the SBI0SR goes High, the SO pin outputs the final bit of the last transferred data until the falling edge of SCK. To terminate transmission/reception write a 0 to SBI0CR1 or a 1 to SBI0CR1 in the interrupt service routine for the INTS2 interrupt. Once SBI0CR1 has been cleared, transmission/reception will be terminated when all the received data bits have been written into SBI0DBR. Check SBI0SR in the program to determine whether transmission/reception has been terminated. SBI0SR is reset to 0 upon the termination of transmission/reception. If SBI0CR1 has been set to 1, transmission/reception will be aborted immediately and SBI0SR cleared to 0.
TMP1942CY/CZ-309
TMP1942CY/CZ
Note: If the transfer mode is changed during transmit/receive operation, the contents of SBI0DBR will be lost. If it is necessary to change the transfer mode, first terminate transmission/reception (by writing a 0 to SBI0CR1) and read out the last received data.
Clear SIOS SCK pin (output) SO pin SI pin INTS2 Interrupt Request SBI0DBR a Write transmit data (a) c b d Read received data (d)
*
a0 c0
a1 c1
a2 c2
a3 c3
a4 c4
a5 c5
a6 c6
a7 c7
b0 d0
b1 d1
b2 d2
b3 d3
b4 d4
b5 d5
b6 d6
b7 d7
Read received data (c) Write transmit data (b)
Figure 3.12.26 Transmit/Receive Mode (example with internal clock)
SCK pin SIOF SO pin bit 6 Bit 7 of last word transmitted tSODH = Min. 4/fsys/2 [s]
Figure 3.12.27 Transmit Data Retention Time When Terminating Transmission/Reception (in Transmit/Receive Mode)
76543210
SBI0CR1 0 1 0 0 0 X X X SBI0DBR X X X X X X X X SBI0CR1 1 0 0 0 0 X X X
Select transmit mode. Write transmit data. Start transmission/reception.
INTS2 interrupt
Reg.
SBIODBR
Read received data. Write transmit data.
SBI0DBR X X X X X X X X
TMP1942CY/CZ-310
TMP1942CY/CZ
3.
3.13 ANALOG/DIGITAL CONVERTER
The TMP1942 contains a 10-bit Half Flash analog/digital converter (A/D converter) with sixteen analog input channels. In addition to normal conversion, the converter supports highest-priority conversion mode, in which continuous conversion can be interrupted by conversion for a specific analog channel. The converter also supports an A/D monitor function, which allows the device to compare the value in the specified conversion result register with the value set in the compare register to determine which is greater. This function enables the device to monitor analog quantities without software intervention. Figure 3.13.1 shows a block diagram of the A/D converter. The pins for the sixteen analog input channels (AN0-AN15) are also used as input-only port pins and/or key input pins.
Note:
When placing the device into IDLE, SLEEP or STOP mode to reduce the device's current consumption, check that the A/D converter has stopped operating before executing the instruction to enter a standby mode. This is necessary because, with some timings, the internal comparator may remain enabled while the device is in a standby mode. When placing the device into SLOW mode, stop the operation of the A/D converter beforehand.
Internal Data Bus ADS Internal Data Bus Internal Data Bus
ADMOD1 ADSCN
ADMOD0
ADMOD2
ADMOD3
ADMOD4 HPADCE
End
Busy Scan
End
Channel Selection Controller
A/D monitor controller start
A/D Monitor Interrupt
repeat Interrupt Interval Normal A/D Conversion Controller Busy A/D Start Controller ADTRG INTTA0/1
Highest-priority A/D Conversion Termination Interrupt
Highest-Priority A/D Conversion Termination Interrupt Interrupt Request INTAD
AN15 (P67) Multiplexer A/D Conversion Result Registers ADREG07L to 8FL ADREG07H to 8FH
Comparison Circuit
- Comparator
AN0 (P50)
A/D Conversion Result Register
VREFH VREFL D/A Converter
Figure 3.13.1 A/D Converter Block Diagram
TMP1942CY/CZ-311
Compare Register
AN7/ADTRG
Sample and Hold
+
TMP1942CY/CZ 3.13.1 Control Registers
The A/D converter is controlled by the A/D mode control registers (ADMOD0, ADMOD1, ADMOD2, ADMOD3 and ADMOD4). Also, the A/D conversion results are stored in the sixteen A/D conversion result upper/lower registers: ADREG08H/L to ADREG7FH/L. The results of highest-priority conversion are stored in ADREGSPH/L. Figure 3.13.2 shows the registers associated with the A/D converter. A/D Mode Control Register 0 7
Bit symbol ADMOD0 (0xFFFF_F318) After Reset Function Read/Write 0 EOCFN R 0 0 0 0
Specifies interrupt generation interval in channel-fixed repeated conversion mode Normal A/D Normal A/D conversion end conversion flag busy flag 0: Before conversion or conversion in progress 1: Conversion completed 0: Conversion not in progress 1: Conversion in progress Repeat interval Specifies in repeat mode interrupt generation 0: No interval interval in 1: 8 A/D clock channel-fixed cycles repeated conversion mode
6
ADBF
5
RI
4
ITM1
3
ITM0 R/W
2
REPEAT 0
Selects repeat mode 0: Single conversion mode 1: Repeated conversion mode
1
SCAN 0
Selects channel scan mode
0
ADS 0
Starts A/D conversion
0: Don't care 0: channel 1: Starts -fixed mode conversion. 1: Channel This bit is scan mode always read as 0.
In channel-fixed mode, this bit specifies the interval between the end of every conversion, every fourth conversion or every eighth conversion, as specified with ITM1:ITM0, and the next conversion being started. In channel scan mode, this bit specifies the interval between the end of a single continuous scan and the next scan being started.
Specifies A/D conversion interrupt generation interval in channel-fixed repeated conversion mode Channel-fixed repeated conversion mode = 0, = 1 00 01 10 11 Generate interrupt every time conversion is performed Generate interrupt every fourth time conversion is performed Generate interrupt every eighth time conversion is performed Setting prohibited
Figure 3.13.2 A/D Converter Registers (1/12)
TMP1942CY/CZ-312
TMP1942CY/CZ
A/D Mode Control Register 1 7
Bit symbol ADMOD1 Read/Write (0xFFFF_F319) After Reset Function IDLE 0: Idle 1: Operate
6
I2AD R/W 0
5

4
ADSCN R/W 0
Selects channel scan operating mode 0: 4-channel scan 1: 8-channel scan
3
ADCH3 0
2
ADCH2 R/W 0
1
ADCH1 0
0
ADCH0 0
Analog input channel selection
Selects Analog Input Channel 0 Channel-fixed
AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 AN8 AN9 AN10 AN11 AN12 AN13 AN14 AN15
1 Channel scan (ADSCN = 0)
AN0 AN0 to AN1 AN0 to AN2 AN0 to AN3 AN4 AN4 to AN5 AN4 to AN6 AN4 to AN7 AN8 AN8 to AN9 AN8 to AN10 AN8 to AN11 AN12 AN12 to AN13 AN12 to AN14 AN12 to AN15
1 Channel scan (ADSCN = 1)
AN0 AN0 to AN1 AN0 to AN2 AN0 to AN3 AN0 to AN4 AN0 to AN6 AN0 to AN6 AN0 to AN7 AN8 AN8 to AN9 AN8 to AN10 AN8 to AN11 AN8 to AN12 AN8 to AN13 AN8 to AN14 AN8 to AN15
0000 0001 0010 0011 0100 0101 0110 0111 (Note) 1000 1001 1010 1011 1100 1101 1110 1111
Note:
The AN7 pin is shared with the ADTRG input. Therefore, do not set to 0111 when using the ADTRG input with ADTRGE set to 1.
Figure 3.13.2 A/D Converter Registers (2/12)
TMP1942CY/CZ-313
TMP1942CY/CZ
A/D Mode Control Register 2 7
Bit symbol ADMOD2 Read/Write (0xFFFF_F31A) After Reset Function EOCFHP R 0
6
ADBFHP R 0
5

Starts
4
HPADCE 0
highest-priority A/D conversion 0: Don't care 1: Starts conversion. This bit is always read as 0.
3
2
R/W
1
0
HPADCH3 HPADCH2 HPADCH1 HPADCH0 0 0 0 0
Highest-priority Highest-priority A/D conversion A/D conversion end flag busy flag 0: Before conversion or conversion in progress 1: Conversion completed 0: Conversion not in progress 1: Conversion in progress
Analog input channel selection for highest-priority A/D conversion

0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Analog Input Channel for Highest-Priority A/D Conversion
AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 AN8 AN9 AN10 AN11 AN12 AN13 AN14 AN15
Figure 3.13.2 A/D Converter Registers (3/12)
TMP1942CY/CZ-314
TMP1942CY/CZ
A/D Mode Control Register 3 7
Bit symbol ADMOD3 Read/Write (0xFFFF_F31B) After Reset Function R/W 0 Must always be set to 0.
6

5
ADOBIC 0
4
REGS3 0
3
REGS2 R/W 0
2
REGS1 0
1
REGS0 0
0
ADOBSV 0 A/D monitor function 0: Disable 1: Enable
A/D monitor Selects A/D conversion result register to be interrupt compared with compare register when A/D generation monitor function is enabled condition 0: Less than compare register 1: Greater than compare register

0000 0001 0010 0011 0100 0101 0110 0111 1XXX
A/D Conversion Result Register to Be Compared
ADREG08 ADREG19 ADREG2A ADREG3B ADREG4C ADREG5D ADREG6E ADREG7F ADREGSP
Figure 3.13.2 A/D Converter Registers (4/12) A/D Mode Control Register 4 7
Bit symbol ADMOD4 Read/Write (0xFFFF_F31C) After Reset Function HADHS 0
Hardware start source for highest-priori ty A/D conversion 0: External trigger 1: INTTA1 interrupt
6
HADHTG R/W 0
Hardware start of highest-priori ty A/D conversion 0: Disable 1: Enable
5
ADHS 0
Hardware start source for normal A/D conversion 0: External trigger 1: INTTA0 interrupt
4
ADHTG 0
Hardware start of normal A/D conversion 0: Disable 1: Enable
3

2

1
ADRST1 W
0
ADRST0 W
Writing 10 and then 01 triggers the software reset of the A/D converter.
Note 1: When performing A/D conversion using a hardware start resource by setting ADHTG or HADHTG to 1, observe the following procedure: To use an external trigger, first set P5FC to 1 (ADTRG) before enabling hardware start. To use an 8-bit timer, first set ADHS or HADHS to 1 to select the use of a timer interrupt. Then, enable hardware start and finally operate the timer to enable A/D conversion to start at constant intervals. Note 2: To change the hardware start resource (from an 8-bit timer to external trigger, or vice versa), first perform a software reset before changing the setting. Note 3: To stop using an external trigger (ADTRG) to start A/D conversion, first disable hardware start (by setting ADHTG or HADHTG to 0) and then set P5FC to 0 to set the pin to a general-purpose port.
Figure 3.13.2 A/D Converter Registers (5/12)
TMP1942CY/CZ-315
TMP1942CY/CZ
A/D Conversion Result Lower Register 08 7
Bit symbol ADREG08L Read/Write (0xFFFF_F300) After Reset Function ADR01 R Undefined
Stores lower 2 bits of A/D conversion result
6
ADR00
5

4

3

2

1
OVR0 R 0
Overrun flag 0: No overrun occurred 1: Overrun occurred
0
ADR0RF R 0
A/D conversion result store flag 1: Conversion result stored
A/D Conversion Result Upper Register 08 7
ADREG08H (0xFFFF_F301) Bit symbol Read/Write After Reset Function ADR09
6
ADR08
5
ADR07
4
ADR06 R Undefined
3
ADR05
2
ADR04
1
ADR03
0
ADR02
Stores upper 8 bits of A/D conversion result
A/D Conversion Result Lower Register 19 7
Bit symbol ADREG19L Read/Write (0xFFFF_F302) After Reset Function ADR11 R Undefined
Stores lower 2 bits of A/D conversion result
6
ADR10
5

4

3

2

1
OVR1 R 0
Overrun flag 0: No overrun occurred 1: Overrun occurred
0
ADR1RF R 0
A/D conversion result store flag 1: Conversion result stored
A/D Conversion Result Upper Register 19 7
Bit symbol ADREG19H (0xFFFF_F303) Read/Write After Reset Function Converted value for channe 9 x 8 7 ADR19
6
ADR18
5
ADR17
4
ADR16 R Undefined
3
ADR15
2
ADR14
1
ADR13
0
ADR12
Stores upper 8 bits of A/D conversion result 6 5 4 3 2 1 0
ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3
ADREGxL 2 1 0
Bits 2 to 5 are always read as 1s.
Note1: Bit 0 is the A/D conversion result store flag ADRxRF. This bit is set to 1 when an A/D converted value is stored in the register pair. This bit is cleared to 0 when the lower register (ADREGxL) is read. Note2: Bit 1 is the overrun flag OVRx. This bit is set to 1 when the next conversion result is written before both conversion result registers (ADREGxH and ADREGxL) have been read. Reading the flag clears the bit. Figure 3.13.2 A/D Converter Registers (6/12)
TMP1942CY/CZ-316
TMP1942CY/CZ
A/D Conversion Result Lower Register 2A 7
Bit symbol ADREG2AL Read/Write (0xFFFF_F304) After Reset Function ADR21 R Undefined
Stores lower 2 bits of A/D conversion result
6
ADR20
5

4

3

2

1
OVR2 R 0
Overrun flag 0: No overrun occurred 1: Overrun occurred
0
ADR2RF R 0
A/D conversion result store flag 1: Conversion result stored
A/D Conversion Result Upper Register 2A 7
ADREG2AH (0xFFFF_F305) Bit symbol Read/Write After Reset Function ADR29
6
ADR28
5
ADR27
4
ADR26 R Undefined
3
ADR25
2
ADR24
1
ADR23
0
ADR22
Stores upper 8 bits of A/D conversion result
A/D conversion result lower register 3B 7
Bit symbol ADREG3BL Read/Write (0xFFFF_F306) After Reset Function ADR31 R Undefined
Stores lower 2 bits of A/D conversion result
6
ADR30
5

4

3

2

1
OVR3 R 0
Overrun flag 0: No overrun occurred 1: Overrun occurred
0
ADR3RF R 0
A/D conversion result store flag 1: Conversion result stored
A/D conversion result upper register 3B 7
Bit symbol ADREG3BH (0xFFFF_F307) Read/Write After Reset Function Converted value for channe 9 x 8 7 ADR39
6
ADR38
5
ADR37
4
ADR36 R Undefined
3
ADR35
2
ADR34
1
ADR33
0
ADR32
Stores upper 8 bits of A/D conversion result 6 5 4 3 2 1 0
ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3
ADREGxL 2 1 0
Bits 2 to 5 are always read as 1s.
Note1: Bit 0 is the A/D conversion result store flag ADRxRF. This bit is set to 1 when an A/D converted value is stored in the register pair. This bit is cleared to 0 when the lower register (ADREGxL) is read. Note2: Bit 1 is the overrun flag OVRx. This bit is set to 1 when the next conversion result is written before both conversion result registers (ADREGxH and ADREGxL) have been read. Reading the flag clears the bit.
Figure 3.13.2 A/D Converter Registers (7/12)
TMP1942CY/CZ-317
TMP1942CY/CZ
A/D Conversion Result Lower Register 4C 7
Bit symbol ADREG4CL Read/Write (0xFFFF_F308) After Reset Function ADR41 R Undefined
Stores lower 2 bits of A/D conversion result
6
ADR40
5

4

3

2

1
OVR4 R 0
Overrun flag 0: No overrun occurred 1: Overrun occurred
0
ADR4RF R 0
A/D conversion result store flag 1: Conversion result stored
A/D Conversion Result Upper Register 4C 7
ADREG4CH (0xFFFF_F309) Bit symbol Read/Write After Reset Function ADR49
6
ADR48
5
ADR47
4
ADR46 R Undefined
3
ADR45
2
ADR44
1
ADR43
0
ADR42
Stores upper 8 bits of A/D conversion result
A/D Conversion Result Lower Register 19 7
Bit symbol ADREG5DL Read/Write (0xFFFF_F30A) After Reset Function ADR51 R Undefined
Stores lower 2 bits of A/D conversion result
6
ADR50
5

4

3

2

1
OVR5 R 0
Overrun flag 0: No overrun occurred 1: Overrun occurred
0
ADR5RF R 0
A/D conversion result store flag 1: Conversion result stored
A/D Conversion Result Upper Register 19 7
Bit symbol ADREG5DH (0xFFFF_F30B) Read/Write After Reset Function Converted value for channe 9 x 8 7 ADR59
6
ADR58
5
ADR57
4
ADR56 R Undefined
3
ADR55
2
ADR54
1
ADR53
0
ADR52
Stores upper 8 bits of A/D conversion result 6 5 4 3 2 1 0
ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3
ADREGxL 2 1 0
Bits 2 to 5 are always read as 1s.
Note1: Bit 0 is the A/D conversion result store flag ADRxRF. This bit is set to 1 when an A/D converted value is stored in the register pair. This bit is cleared to 0 when the lower register (ADREGxL) is read. Note2: Bit 1 is the overrun flag OVRx. This bit is set to 1 when the next conversion result is written before both conversion result registers (ADREGxH and ADREGxL) have been read. Reading the flag clears the bit.
Figure 3.13.2 A/D Converter Registers (8/12)
TMP1942CY/CZ-318
TMP1942CY/CZ
A/D Conversion Result Lower Register 6E 7
Bit symbol ADREG6EL Read/Write (0xFFFF_F30C) After Reset Function ADR61 R Undefined
Stores lower 2 bits of A/D conversion result
6
ADR60
5

4

3

2

1
OVR6 R 0
Overrun flag 0: No overrun occurred 1: Overrun occurred
0
ADR6RF R 0
A/D conversion result store flag 1: Conversion result stored
A/D Conversion Result Upper Register 6E 7
ADREG6EH (0xFFFF_F30D) Bit symbol Read/Write After Reset Function ADR69
6
ADR68
5
ADR67
4
ADR66 R Undefined
3
ADR65
2
ADR64
1
ADR63
0
ADR62
Stores upper 8 bits of A/D conversion result
A/D Conversion Result Lower Register 7F 7
Bit symbol ADREG7FL Read/Write (0xFFFF_F30E) After Reset Function ADR71 R Undefined
Stores lower 2 bits of A/D conversion result
6
ADR70
5

4

3

2

1
OVR7 R 0
Overrun flag 0: No overrun occurred 1: Overrun occurred
0
ADR7RF R 0
A/D conversion result store flag 1: Conversion result stored
A/D Conversion Result Upper Register 7F 7
Bit symbol ADREG7FH (0xFFFF_F30F) Read/Write After Reset Function Converted value for channe 9 x 8 7 ADR79
6
ADR78
5
ADR77
4
ADR76 R Undefined
3
ADR75
2
ADR74
1
ADR73
0
ADR72
Stores upper 8 bits of A/D conversion result 6 5 4 3 2 1 0
ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3
ADREGxL 2 1 0
Bits 2 to 5 are always read as 1s.
Note1: Bit 0 is the A/D conversion result store flag ADRxRF. This bit is set to 1 when an A/D converted value is stored in the register pair. This bit is cleared to 0 when the lower register (ADREGxL) is read. Note2: Bit 1 is the overrun flag OVRx. This bit is set to 1 when the next conversion result is written before both conversion result registers (ADREGxH and ADREGxL) have been read. Reading the flag clears the bit.
Figure 3.13.2 A/D Converter Registers (9/12)
TMP1942CY/CZ-319
TMP1942CY/CZ
A/D Conversion Result Lower Register SP 7
Bit symbol ADREGSPL Read/Write (0xFFFF_F310) After Reset Function ADRSP1 R Undefined
Stores lower 2 bits of A/D conversion result
6
ADRSP0
5

4

3

2

1
OVRSP R 0
Overrun flag 0: No overrun occurred 1: Overrun occurred
0
ADRSPRF R 0
A/D conversion result store flag 1: Conversion result stored
A/D Conversion Result Upper Register SP 7
ADREGSPH (0xFFFF_F311) Bit symbol Read/Write After Reset Function Converted value for channe 9 x 8 7 ADRSP9
6
ADRSP8
5
ADRSP7
4
ADRSP6 R Undefined
3
ADRSP5
2
ADRSP4
1
ADRSP3
0
ADRSP2
Stores upper 8 bits of A/D conversion result 6 5 4 3 2 1 0
ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3
ADREGxL 2 1 0
Bits 2 to 5 are always read as 1s.
Note1: Bit 0 is the A/D conversion result store flag ADRxRF. This bit is set to 1 when an A/D converted value is stored in the register pair. This bit is cleared to 0 when the lower register (ADREGxL) is read. Note2: Bit 1 is the overrun flag OVRx. This bit is set to 1 when the next conversion result is written before both conversion result registers (ADREGxH and ADREGxL) have been read. Reading the flag clears the bit. Figure 3.13.2 A/D Converter Registers (10/12) A/D Conversion Result Lower Register 7
Bit symbol ADREGSPL Read/Write (0xFFFF_F314) After Reset Function ADR21 R/W Undefined
Stores lower 2 bits of A/D conversion result
6
ADR20
5

4

3

2

1
R 0
0
R 0
A/D Conversion Result Compare Upper Register 7
ADREGSPH (0xFFFF_F315) Bit symbol Read/Write After Reset Function ADR29
6
ADR28
5
ADR27
4
ADR26 R/W 0
3
ADR25
2
ADR24
1
ADR23
0
ADR22
Stores upper 8 bits of A/D conversion result
Note: When setting or modifying a value in these registers, first disable the A/D monitor function by setting ADMOD3 to 0.
Figure 3.13.2 A/D Converter Registers (11/12)
TMP1942CY/CZ-320
TMP1942CY/CZ
Stores lower 2 bits of A/D conversion result 7
ADCCLK (0xFFFF_F31F) Bit symbol Read/Write After Reset
6

5

4

3

2
ADCCK2 R/W 0
1
ADCCK1 R/W 0
0
ADCCK0 R/W 0
Selects prescaler output for A/D converter 000: fadc
Function
001: Divided by 2 010: Divided by 4 011: Divided by 8 1XX: Divided by 16
Note 1: A/D conversion is executed using the clock selected by the above register. However, if the accuracy of conversion needs to be guaranteed, be sure to choose a conversion clock frequency such that the conversion period is at least 1 s, that is, 2 MHz or less in terms of A/D conversion clock frequency. Note 2: Do not change the conversion clock frequency while A/D conversion is in progress. After conversion is completed, wait at least 2 ADCLK cycles before changing the clock frequency.
ADCLK2:0 PHYT0 /2 /4 /8 /16
ADCLK
Figure 3.13.2 A/D Converter Registers (12/12)
TMP1942CY/CZ-321
TMP1942CY/CZ 3.13.2 Functional description
(1) Analog reference voltage Apply the High-level analog reference voltage to the VREFH pin and the Low-level analog reference voltage to the VREFL pin. VREF is automatically turned on when A/D conversion is started and turned off when conversion is completed, thus preventing IREF from flowing unnecessarily. (2) Selecting the analog input channel The procedure for selecting the analog input channel varies with the A/D converter operating mode. (2-1) Analog reference voltage * Using a fixed analog input channel (ADMOD0 = 0) Choose one of the pins AN0 to AN15 as the analog input channel by setting ADMOD1 to the appropriate value. * Scanning analog input channels (ADMOD0 = 1) Choose one of the 24 available scan modes by setting ADMOD1 and ADSCN to the appropriate values. (2-2) Highest-priority A/D conversion Choose one of the pins AN0 to AN15 as the analog input channel by setting ADMOD2 to the appropriate value. After a reset, channel-fixed input on the AN0 pin is selected since ADMOD0 and ADMOD1 are initialized to 0 and 0000, respectively. The pins other than that used as the analog input channel can be used as ordinary input port pins. If highest-priority A/D conversion is activated during normal A/D conversion, highest-priority A/D conversion is performed upon the completion of the current conversion cycle. Normal A/D conversion is resumed upon the completion of highest-priority A/D conversion. Example: When highest-priority A/D conversion for AN15 (ADMOD2 = 1111) is activated during repeated scan conversion for channels AN0 to AN3 (ADMOD0 = 10 and ADMOD1 = 0011)
Highest-priority A/D Conversion Activated Channel Converted Ch0 Ch1 Ch2 Ch15 Ch3 Ch0 Ch1
TMP1942CY/CZ-322
TMP1942CY/CZ
(3) Starting A/D conversion A/D conversion is classified into normal A/D conversion and highest-priority A/D conversion. Normal A/D conversion can be initiated programmatically by setting ADMOD0 to 1. Highest-priority A/D conversion can be initiated programmatically by setting ADMOD2 to 1. Normal A/D conversion is performed in one of the four operating modes as specified with ADMOD0<2:1>. Highest-priority A/D conversion is only performed in channel-fixed single conversion mode. A/D conversion can also be activated by a hardware start source, which is specified with ADMOD4 for normal A/D conversion and ADMOD4 for highest-priority A/D conversion. When the ADHS or HADHS bit is set to 0, A/D conversion is triggered by a falling edge on the ADTRG pin. When the bit is set to 1, normal A/D conversion is triggered by INTTA0 from 8-bit timer 0 and highest-priority A/D conversion is triggered by INTTA1 from 8-bit timer 1. A/D conversion can still be started programmatically if hardware start is enabled. When normal A/D conversion starts, the normal A/D conversion busy flag (ADMOD0) is set to 1, indicating that normal A/D conversion is in progress. When highest-priority A/D conversion starts, the highest-priority A/D conversion busy flag (ADMOD2) is set to 1, indicating that highest-priority A/D conversion is in progress, with the normal A/D conversion busy flag and end flag (EOCFN) holding the values they had before highest-priority A/D conversion starts. Normal A/D conversion can be restarted by setting ADMOD0 to 1 during normal A/D conversion. Restarting normal A/D conversion cancels the current conversion. However, if all necessary sampling operations have been completed for the current conversion, the conversion result is stored before A/D conversion is restarted. If the start of normal A/D conversion using a hardware resource is enabled, normal A/D conversion is restarted when the start condition for the resource is satisfied during normal A/D conversion. The current conversion is cancelled when normal A/D conversion is restarted. However, if all necessary sampling operations have been completed for the current conversion, the conversion result is stored before A/D conversion is restarted. If ADMOD2 is set to 1 during normal A/D conversion, the result of the current conversion is stored in the conversion result registers, after which highest-priority A/D conversion starts, that is, A/D conversion for the channel specified with ADMOD2<3:0> (channel-fixed single conversion) starts. Once the result of highest-priority conversion is stored in ADREGSP, normal A/D conversion is resumed following the last conversion for which the result was stored. If the start of highest-priority A/D conversion using a hardware resource is enabled and the start condition for the resource is satisfied during normal A/D conversion, the result of the current conversion is stored in the conversion result registers, after which highest-priority A/D conversion starts, that is, A/D conversion for the channel specified with ADMOD2<3:0> (channel-fixed single conversion) starts. Once the result of highest-priority conversion is stored in ADREGSP, normal A/D conversion is resumed following the last conversion for which the result was stored. Highest-priority A/D conversion is not restarted even if ADMOD2 is set to 1 during highest-priority A/D conversion.
TMP1942CY/CZ-323
TMP1942CY/CZ
(4) A/D conversion modes and the A/D conversion completed interrupt The following four A/D conversion modes are available for normal A/D conversion, as specified with the settings of ADMOD0<2:1>. Highest-priority A/D conversion always operates in channel-fixed single conversion mode regardless of the settings of ADMOD0<2:1>. * * * * Channel-fixed single conversion mode Channel scan single conversion mode Channel-fixed repeated conversion mode Channel scan repeated conversion mode
(4-1) Normal A/D conversion Use ADMOD0 to select the A/D conversion mode. When A/D conversion has been started, ADMOD0 is set to 1. When the specified A/D conversion has been completed, an A/D conversion completed interrupt (INTAD) is generated and ADMOD0 is set to 1, indicating that A/D conversion has been completed. If REPEAT = 0, ADBFN is cleared to 0 simultaneously when EOCF is set to 1. If REPEAT = 1, however, conversion continues with ADBFN held to be 1. (a) Channel-fixed single conversion mode Channel-fixed single conversion mode is selected by setting ADMOD0 to 00. In this mode, conversion is performed once for a single selected channel. After the conversion has been completed, ADMOD0 will be set to 1 and ADMOD0 cleared to 0, thereby generating an INTAD interrupt request. EOCF can be cleared to 0 by reading it. (b) Channel scan single conversion mode Channel scan single conversion mode is selected by setting ADMOD0 to 01. In this mode, conversion is performed once for each selected channel which is scanned. After the scan conversion has been completed, ADMOD0 will be set to 1 and ADMOD0 cleared to 0, thereby generating an INTAD interrupt request. EOCF can be cleared to 0 by reading it. (c) Channel-fixed repeated conversion mode Channel-fixed repeated conversion mode is selected by setting ADMOD0 to 10. In this mode, conversion is performed repeatedly for a single selected channel. After the conversion has been completed, ADMOD0 will be set to 1. ADMOD0, however, remains at 1 and is not cleared to 0. The timing at which an INTAD interrupt request will be generated depends on the settings of ADMOD0, which also determine the timing at which EOCF is set. EOCF can be cleared to 0 by reading it. If ADMOD0 = 00, an interrupt request will be generated for each A/D conversion session completed. In that case, the conversion result is always stored in ADREG08. EOCF becomes 1 once the conversion result has been stored.
TMP1942CY/CZ-324
TMP1942CY/CZ
If ADMOD0 = 01, an interrupt request will be generated for every fourth A/D conversion session completed. In that case, the conversion results are stored sequentially in registers ADREG08 through ADREG3B. EOCF becomes 1 once the conversion result has been stored in ADREG3B. The next conversion result will be stored in ADREG08 again. EOCF can be cleared to 0 by reading it. If ADMOD0 = 10, an interrupt request will be generated for every eighth A/D conversion session completed. In that case, the conversion results are stored sequentially in registers ADREG08 through ADREG7F. EOCF becomes 1 once the conversion result has been stored in ADREG7F. The next conversion result will be stored in ADREG08 again. EOCF can be cleared to 0 by reading it. The setting of ADMOD0 determines the repeat interval for repeated conversion mode. If ITM1:ITM0 = 00, this bit controls the interval between a single conversion being completed and the next conversion being started. If ITM1:ITM0 = 01, the bit controls the interval between four conversions being completed and the next conversion being started. If ITM1:ITM0 = 10, the bit controls the interval between eight conversions being completed and the next conversion being started. (d) Channel scan repeated conversion mode Channel scan repeated conversion mode is selected by setting ADMOD0 to 11. In this mode, conversion is performed repeatedly for selected scanned channels. Each time one scan conversion operation has been completed, ADMOD0 will be set to 1, thereby generating an INTAD interrupt request. ADMOD0 remains at 1 and is not cleared to 0. EOCF can be cleared to 0 by reading it. To stop operation in repeat conversion mode (mode (c) or (d) ), write a 0 to ADMOD0. Repeat conversion mode will then be terminated and ADMOD0 cleared to 0 as soon as the conversion currently in progress has been completed. If ADMOD1 = 0 and the device enters a standby state (IDLE, SLEEP or STOP mode), the A/D converter will immediately stop operating, even if A/D conversion is in progress. After the device has exited the standby state, if the A/D converter is operating in repeat conversion mode (mode (c) or (d) ), A/D conversion will start again from the beginning (the register settings remain the same, status information is initialized and operation is restarted from the beginning); however, if the A/D converter is operating in single conversion mode (mode (a) or (b) ), it will not restart conversion operation (it will remain stopped). (4-2) Highest-priority A/D conversion Highest-priority A/D conversion is only performed in channel-fixed single conversion mode, regardless of the settings of ADMOD0. When the start condition is satisfied, conversion for the channel specified with ADMOD2 is performed once. After the conversion has been completed, a highest-priority A/D conversion completed interrupt will be generated, ADMOD2 set to 1 and cleared to 0. The EOCFHP flag can be cleared to 0 by reading it.
TMP1942CY/CZ-325
TMP1942CY/CZ
Table 3.13.1 Relationship Among A/D Conversion Modes, Interrupt Generation Timing and Flag Operation Conversion Mode Interrupt Generation Timing ADMOD0 EOCF Setting Timing ADBF (After Interrupt (*1) is Generated) ITM1:0 REPEAT SCAN
After conversion has been completed Every time one conversion has been completed 0 1 (*2) 1 (*2) 1 (*2) 00 01 10 1 0 0 0
Channel-fixed After conversion has been single conversion completed Every time one conversion has been completed
Channel-fixed repeated conversion
Every time four conversions Every time four conversions have been completed have been completed Every time eight conversions Every time eight conversions have been completed have been completed
Channel scan After scan conversion has single conversion been completed Channel scan repeated conversion Every time one scan conversion has been completed
After scan conversion has been completed Every time one scan conversion has been completed
0
0
1
1 (*2)
1
1
(Note*1) EOCF is cleared when it is read. (Note*2) If repeat intervals are used with RI set to 1, ADBF indicates 0 during interval periods.
ADMOD0 can be used to control the time between one scan conversion being completed and the next scan conversion being started (repeat interval). This bit is only effective when REPEAT = 1. Example: When repeated scan for channels AN0 to AN2 is set
Repeated scan conversions when RI = 0
Channel Converted 0 1 First Scan 2 0 1 Second Scan 2 0 Third Scan
Repeated scan conversions when RI = 1
Channel Converted 0 1 First Scan 2 0 Interval of 8 ADC clock cycles 1 2 Second Scan 0
Note: If the start condition for highest-priority A/D conversion is satisfied during an interval period, highest-priority A/D conversion is started immediately. Since the interval counter continues running during highest-priority A/D conversion, the next scan will start when both of the following conditions are satisfied: an overflow of the interval counter and the completion of highest-priority A/D conversion.
(5) Highest-priority conversion mode Highest-priority A/D conversion can be performed by interrupting normal A/D conversion. Highest-priority A/D conversion can be started either programmatically by setting ADMOD2 to 1 or by using a hardware resource as specified with ADMOD4<7:6>. If highest-priority A/D conversion is started during normal A/D conversion, the converter first stores the result of the current conversion to the appropriate result register pair, and then performs a single conversion for the channel specified with ADMOD2<3:0>. The result of that conversion is stored in ADREGSP, at which point a highest-priority A/D conversion interrupt is generated. Then, normal A/D conversion is resumed following the last conversion for which the result was stored. Any condition that triggers highest-priority A/D conversion is ignored while highest-priority A/D conversion is in progress. For example, suppose channel scan repeated conversion is being performed for AN0 to AN8. If HPADCE is set to 1 during conversion for AN3, the converter will wait for the conversion for AN3
TMP1942CY/CZ-326
TMP1942CY/CZ
to complete and then perform conversion for the channel specified with HPADC3:HPADC0. After storing the result of that conversion in ADREGSP, the converter resumes channel scan repeated conversion from AN4. (6) A/D monitor function Setting ADMOD3 to 1 enables the A/D monitor function, which generates an A/D monitor interrupt if the value of the conversion result register specified with REGS<3:0> is greater or less (as specified with ADOBIC) than the value of the compare register. This comparison is performed each time the result is stored in the specified conversion result register, and an interrupt is generated if the condition is satisfied. Since the conversion result register used for the A/D monitor function is usually not read in the program, its overrun flag (OVRn) and conversion result store flag (ADRnRF) are always set. Therefore, do not use those flags of the conversion result register used for the A/D monitor function. (7) A/D conversion time Two clock pulses are required for a single A/D conversion. The A/D conversion clock frequency can be selected from among prescaler outputs PHYT0, PHYT1, PHYT2, PHYT4 and PHYT8. To guarantee the accuracy of the conversion, the A/D conversion time must be at least 1 s, that is, 2 MHz or less in terms of A/D conversion clock frequency. The following figure and tables show example settings: Example: Repeated scan conversion for channels 0 to 2 (ADC clock frequency = 1 MHz)
Start Conversion
SMP: Sample Hold CMP: A/D Conversion SAVE: Store Result Set-up SMP CMP 45 Clcok (4 to 5 sec) SAVE 2 Clcok (2 sec) 2 Clcok (2 sec)
Conversion for Channel 0
Conversion for Channel 1
SMP
CMP
SAVE
4 Clock (4 sec)
Conversion for Channel 2
SMP
CMP
SAVE
Conversion for Channel 0
ADC 1 Clock (1 m@max)
4 Clcok (4 sec) SMP CMP
TMP1942CY/CZ-327
TMP1942CY/CZ
Table 3.13.2 Example A/D Conversion Settings (1)
@f = 32 MHz
Peripheral Clock Select
Clock Gear
Prescaler Clock Source 00 (fperiph/4)
A/D Conversion Time T0
Invalid setting Invalid setting Invalid setting Invalid setting Invalid setting Invalid setting
T1
Invalid setting Invalid setting Invalid setting
T2 1s
Invalid setting Invalid setting
T4 2s 1s
Invalid setting
T8 4s 2s 1s 8s 4s 2s 16s 8s 4s 32s 16s 8s 4s 2s 1s 8s 4s 2s 16s 8s 4s 32s 16s 8s
00 (fc)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
1s
Invalid setting Invalid setting
2s 1s
Invalid setting
4s 2s 1s 8s 4s 2s 16s 8s 4s 2s 1s
Invalid setting
01 (fc/2) 0 (fgear)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
1s
Invalid setting Invalid setting
2s 1s
Invalid setting
4s 2s 1s 8s 4s 2s 1s
Invalid setting Invalid setting
10 (fc/4)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
2s 1s
Invalid setting Invalid setting Invalid setting Invalid setting Invalid setting Invalid setting Invalid setting
4s 2s 1s
Invalid setting Invalid setting Invalid setting
11 (fc/8)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
00 (fc)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
1s
Invalid setting Invalid setting
2s 1s
Invalid setting
4s 2s 1s 8s 4s 2s 16s 8s 4s
01 (fc/2) 1 (fc)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
1s
Invalid setting Invalid setting
2s 1s
Invalid setting
4s 2s 1s 8s 4s 2s
10 (fc/4)
01 (fperiph/2) 10 (fperiph) 00 (fperiph/4)
2s 1s
Invalid setting
4s 2s 1s
11 (fc/8)
01 (fperiph/2) 10 (fperiph)
TMP1942CY/CZ-328
TMP1942CY/CZ
Table 3.13.3 Example A/D Conversion Settings (2)
@f = 32 MHz
PHYT0 fadc
16MHz 12 MHz 10 MHz 8 MHz 4 MHz 2MHz Invalid setting Invalid setting Invalid setting Invalid setting Invalid setting Invalid setting
Conversion Clock fadc /2
Invalid setting Invalid setting Invalid setting Invalid setting Invalid setting 2 sec
fadc /4
Invalid setting Invalid setting Invalid setting Invalid setting 2 sec 4 sec
fadc /8
Invalid setting Invalid setting Invalid setting 2 sec 4 sec 8 sec
fadc /16
2 sec 2.8sec 3.2sec 4 sec 8 sec 16 sec
Note:
The maximum conversion speed, that is, the minimum conversion time this A/D converter can achieve is 2 s. However, 4 s is required before the first conversion result can be retrieved from the conversion result register (or a maximum of 5 s is required depending on the conversion start request timing because of the interface between the system clock and A/D conversion clock). Subsequently, conversion results can be obtained every 2 s. Therefore, in single conversion mode or highest-priority conversion mode, A/D conversion requires 4 or 5 times the conversion time shown in the above table. In repeated conversion or scan mode, only the first conversion requires 4 or 5 times the table value (a maximum of 4 to 5 s) but subsequent conversions are performed within the time shown in the table (a maximum of 2 s).
TMP1942CY/CZ-329
TMP1942CY/CZ
(8) Storing and reading out A/D conversion results A/D conversion results are stored in A/D conversion result upper/lower registers (ADREG08H/L to ADREG7FH/L). In channel-fixed repeated conversion mode, A/D conversion results are sequentially stored in ADREG08H/L to ADREG7FH/L. However, if ITM1 and ITM0 specify that an interrupt be generated every time conversion has been completed, conversion results will be stored in ADREG08H/L only. If ITM1 and ITM0 specify that an interrupt be generated every fourth time conversion has been completed, conversion results will be sequentially stored in ADREG08H/L to ADREG3BH/L. Table 3.13.3 shows the relationship between analog input channels and A/D conversion result registers. Table 3.13.3 Relationship Between Analog Input Channels and A/D Conversion Result Registers Analog Input Channel (Port A)
AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 AN8 AN9 AN10 AN11 AN12 AN13 AM14 AM15
A/D Conversion Result Register Other than channel-fixed Channel-fixed repeated conversion repeated conversion mode mode (every eighth time)
ADREG08H/L ADREG19H/L ADREG2AH/L ADREG3BH/L ADREG4CH/L ADREG5DH/L ADREG6EH/L ADREG7FH/L ADREG08H/L ADREG19H/L ADREG2AH/L ADREG3BH/L ADREG4CH/L ADREG5DH/L ADREG6EH/L ADREG7FH/L ADREG7FH/L = 00 ADREG08H/L = 01 ADREG08H/L ADREG3BH/L = 10 ADREG08H/L ADREG7FH/L ADREG08H/L
In highest-priority A/D conversion mode, conversion results are always stored in ADREGSPH/L. (9) Data polling To process the results of A/D conversion by means of data polling rather than using an interrupt, poll ADMOD0. If this flag is set, the appropriate A/D conversion result register pair contains the conversion result. Check the flag and then, if it is set, read the A/D conversion result registers. To detect an overrun, first read the upper register and then the lower register. The conversion result is valid if OVRn =0 and ADRnRF = 1 in the lower register.
TMP1942CY/CZ-330
TMP1942CY/CZ
3.
3.14 Digital/Analog Converter
This section describes the D/A converter the TMP1942 contains.
3.14.1
Features
* * * Three 10-bit D/A converter channels. Each channel contains a full-range buffer amplifier. Each channel can be placed in standby state using control registers.
3.14.2
Operation
When the OP and REFON bits of the control register DACCNTn are set to 1s, writing output code and the VALID bit to the output register pair DAREGnL/DAREGnH causes the voltage corresponding to the output code to appear on the DAOUTn output pin. The value in the output registers will be reflected in DAOUT only if the VALID bit is set. Therefore, when updating the code, set the VALID bit if 10-bit data has been updated in DAREGnH first and then DAREGnL. Once the VALID bit has been set to 1, the value stored in DAREGnL/H is fetched into the D/A converter as 10-bit data, which will be recognized as code. Setting DACCNTn to 0 places the DAOUTn output pin into the high-impedance state. Setting DACCNTn to 0 enables reduction of current consumption by decreasing Iref.
V CLR Controller
DAREGnL 2
DAREGnH 8
W
Internal DAREG (10 bits) 10 AVSS
DAC Controller Amplifier DAOUTn
Opn
REFONn
DACCNTn DAREFHH System Diagram for DACn
Figure 3.14.1 D/A Converter Block Diagram
TMP1942CY/CZ-331
Resistor Section
TMP1942CY/CZ
DACCNT0 Register 7
(0xFFFF_F342) Bit symbol Read/Write After Reset Function
6

5

4

3

2

1
REFON0 R/W 0
0: Ref off 1: Ref on
0
OP0 R/W 0
0: Output high-impe dance 1: Output
DACCNT1 Register 7
(0xFFFF_F346) Bit symbol Read/Write After Reset Function
6

5

4

3

2

1
REFON1 R/W 0
0: Ref off 1: Ref on
0
OP1 R/W 0
0: Output high-impe dance 1: Output
DACCNT2 Register 7
(0xFFFF_F34A) Bit symbol Read/Write After Reset Function
6

5

4

3

2

1
REFON2 R/W 0
0: Ref off 1: Ref on
0
OP2 R/W 0
0: Output high-impe dance 1: Output
Output Register DAREG0L 7
(0xFFFF_F340) Bit symbol Read/Write After Reset Function DAC01 R/W 0
6
DAC00 R/W 0
5
R/W 0
be set to 0.
4
R/W 0
be set to 0.
3

2

1

0
VALID W 0
0: Don't care 1: Output code valid
Must always Must always
Output Register DAREG0H 7
(0xFFFF_F341) Bit symbol Read/Write After Reset Function 0 0 0 0 DAC09
6
DAC08
5
DAC07
4
DAC06 R/W
3
DAC05 0
2
DAC04 0
1
DAC03 0
0
DAC02 0
Note: When writing data to DAREG0, first write DAREG0H and then DAREG0L, using byte accesses.
TMP1942CY/CZ-332
TMP1942CY/CZ
Output Register DAREG1L 7
(0xFFFF_F344) Bit symbol Read/Write After Reset Function DAC1 R/W 0
6
DAC0 R/W 0
5
R/W 0
4
R/W 0
3

2

1

0: Ref off 1: Ref on
0
VALID W 0
0: Don't care 1: Output code valid
Must always Must always be set to 0. be set to 0.
Output Register DAREG1H 7
(0xFFFF_F345) Bit symbol Read/Write After Reset Function DAC9 0
6
DAC8 0
5
DAC7 0
4
DAC6 R/W 0
3
DAC5 0
2
DAC4
1
DAC3 0
0
DAC2 0
0
Output Register DAREG2L 7
(0xFFFF_F348) Bit symbol Read/Write After Reset Function DAC1 R/W 0
6
DAC0 R/W 0
5
R/W 0
4
R/W 0
3

2

1

0
VALID W 0
0: Don't care 1: Output code valid
Must always Must always be set to 0. be set to 0.
Output Register DAREG2H 7
(0xFFFF_349) Bit symbol Read/Write After Reset Function DAC9 0
6
DAC8 0
5
DAC7 0
4
DAC6 R/W 0
3
DAC5 0
2
DAC4
1
DAC3 0
0
DAC2 0
0
Note: When writing data to DAREG1 and DAREG0, first write DAREGnH and then DAREGnL, using byte accesses.
TMP1942CY/CZ-333
TMP1942CY/CZ
3.
3.15 Key on Wake-up Circuit
3.15.1 Overview
* 14 inputs, KEY0 to KEYD, can be used to terminate STOP/SLEEP mode or as an external interrupt. However, all 14 inputs must be set collectively (in the CG block). Whether individual pins are used or not used can be specified separately (KWUPSTn). A single interrupt source is available. Rising edge, falling edge, High level, or Low level detection can be selected for individual inputs (KWUPSTn). The interrupt source is cleared by KWUPCLR in the interrupt handling routine. Key input pins have pull-up resistors which can be enabled or disabled by setting bit 0 (PE) of KWUPCNT. Bit 1 (DPE) specifies whether the pull-up resistors are dynamic or static. Pull-up resistors cannot be set individually.
* * * *
3.15.2
Key on wake-up operation
The TMP1942 has 14 key input pins (KEY0 to KEYD). The KWUPEN bit of the IMCGB1 register in the CG specifies whether the key inputs are used to terminate standby mode or as an ordinary interrupt. Setting the bit to 1 causes all of KEY0 to KEYD to be used to terminate standby mode. Use KWUPSTn to specify whether to use each key input and KWUPSTn to specify the active condition for each key input. The key on wake-up circuit detects key inputs and reports the result of detection to the CG IMCGB1 register using an active High signal. Therefore, set the detection level to High level by setting IMCGB1 to 01. Since the result of detection in the CG is also reported to the interrupt controller (INTC) as an active High signal, set the corresponding interrupt to High level-detected in the INTC. Setting IMCGB1 to 0 (default) causes all of KEY0 to KEYD to be used as ordinary interrupts. In that case, set the detection level to High level in the INTC but the CG need not be set. Also use KWUPSTn to specify whether each key input is used and its active condition. In the interrupt handling routine, write 1010 to KWUPCLR to clear all key interrupts.
Note: If two or more key inputs are detected at different times, the second key input is cleared simultaneously with the first key input if the second key input is detected before the key interrupt clearing sequence in the interrupt handling routine for the first key input. If the second key input is detected after the clearing sequence for the first key input, a key interrupt will be generated again.
3.15.3
Pull-up function
Each key input has a pull-up resistor. Setting KWUPCNT to 1 results in all of KEY0 to KEYD being pulled up. However, any key inputs which have been specified not to be used with KWUPSTn will not be pulled up regardless of the setting of this bit. Setting KWUPCNT to 1 selects dynamic pull-up mode, where the key inputs are pulled up only during given periods at a frequency specified with T1S1:T1S0 and T2S1:T2S0. In this mode, current consumed by the key inputs can be reduced. When DPE is set to 0, the key inputs are always pulled up.
TMP1942CY/CZ-334
TMP1942CY/CZ
Note1: Procedures for using key inputs in static pull-up mode A) When setting key inputs first after powering up the device 1) Set KWUPCNT (PE = 1, DPE = 0). 2) Set the KWUPSTn corresponding to the key inputs to be used to 1. 3) Wait until the pull-up resistors are disabled. 4) Set the active conditions using the KWUPSTn corresponding to the key inputs to be used. 5) Clear the interrupt request using KWUPCLR. 6) Set the CG and INTC (refer to Section 3.4, "Interrupts" for details). B) When modifying the active condition for a key input during operation 1) Disable key interrupts in the INTC (IMC1<18:16> = 000). 2) Modify the active condition for the key input using the corresponding KWUPSTn. 3) Clear the interrupt request using KWUPCLR. 4) Enable key interrupts in the INTC (set IMC1<18:16> to an appropriate level). C) When enabling a key input during operation 1) Disable key interrupts in the INTC (IMC1<18:16> = 000). 2) Set the KWUPSTn corresponding to the key input to be used to 1. 3) Wait until the pull-up resistors are disabled. 4) Set the active condition using the KWUPSTn corresponding to the key input to be used. 5) Clear the interrupt request using KWUPCLR. 6) Enable key interrupts in the INTC (set IMC1<18:16> to an appropriate level).
Note2 : Procedures for using key inputs in dynamic pull-up mode A) When setting key inputs first after powering up the device 1) Set KWUPCNT (PE = 1, DPE = 0, TnSn = desired time). 2) Set the active conditions using the KWUPSTn corresponding to the key inputs to be used. 3) Clear the interrupt request using KWUPCLR. 4) Set the KWUPSTn corresponding to the key inputs to be used to 1. 5) Set the CG and INTC (refer to Section 3.4, "Interrupts" for details). B) When modifying the active condition for a key input during operation 1) Disable key interrupts in the INTC (IMC1<18:16> = 000). 2) Modify the active condition for the key input using the corresponding KWUPSTn. 3) Clear the interrupt request using KWUPCLR. 4) Enable key interrupts in the INTC (set IMC1<18:16> to an appropriate level). C) When enabling a key input during operation 1) Disable key interrupts in the INTC (IMC1<18:16> = 000). 2) Set the active condition using the KWUPSTn corresponding to the key input to be used. 3) Clear the interrupt request using KWUPCLR. 4) Set the KWUPSTn corresponding to the key input to be used to 1. 5) Enable key interrupts in the INTC (set IMC1<18:16> to an appropriate level).
TMP1942CY/CZ-335
TMP1942CY/CZ
Note3: Procedures for using key inputs without pull-up resistors A) When setting key inputs first after powering up the device 1) Set KWUPCNT (PE = 0, DPE = 0). 2) Set the active conditions using the KWUPSTn corresponding to the key inputs to be used. 3) Clear the interrupt request using KWUPCLR. 4) Set the KWUPSTn corresponding to the key inputs to be used to 1. 5) Set the CG and INTC (refer to Section 3.4, "Interrupts" for details). B) When modifying the active condition for a key input during operation 1) Disable key interrupts in the INTC (IMC1<18:16> = 000). 2) Modify the active condition for the key input using the corresponding KWUPSTn. 3) Clear the interrupt request using KWUPCLR. 4) Enable key interrupts in the INTC (set IMC1<18:16> to an appropriate level). C) When enabling a key input during operation 1) Disable key interrupts in the INTC (IMC1<18:16> = 000). 2) Set the active condition using the KWUPSTn corresponding to the key input to be used. 3) Clear the interrupt request using KWUPCLR. 4) Set the KWUPSTn corresponding to the key input to be used to 1. 5) Enable key interrupts in the INTC (set IMC1<18:16> to an appropriate level).
Note: Ensure that fs is operating before attempting to enable dynamic pull-up by setting DPE to 1. If DPE is set to 1 when fs is not operating, key inputs cannot be detected.
TMP1942CY/CZ-336
TMP1942CY/CZ
Key on wake-up control register KWUPCNT 7
(0xFFFF_F371) Bit symbol Read/Write After Reset Function R/W 0 Must always be set to 0.
6

5
T2S1 Dynamic pull-up interval
4
T2S0
3
T1S1 R/W
2
T1SO
1
DPE 0
0
KYPE 0 0: Disable pull-up
Dynamic pull-up period 0: Static pull-up 00: 4/fs 10: 16/fs 01: 8/fs 11: 32/fs
00: 128/fs 10: 512 /fs 01: 256/fs 11: 1024/fs
1: Dynamic 1: Enable pull-up pull-up
The following illustrates operation in dynamic pull-up mode:
T1 T2
Key inputs are pulled up only during the T1 periods as specified with T1S1: T1S0. 00: 4/fs (125 s @ fs=32kHz) 01: 8/fs (250 s @ fs=32kHz) 10: 16/fs (500 s @ fs=32kHz) 11: 32/fs (1 ms @ fs=32kHz) Dynamic pull-up is repeated at intervals of T2 as specified with T2S1:T2S0. 00: 128/fs (4 ms @ fs=32kHz) 01: 256/fs (8 m @ fs=32kHz s) 10: 512/fs (16 ms @ fs=32kHz) 11: 1024/fs (32 ms @ fs=32kHz)
3.15.4
Detecting Key Inputs and Detection Timing
1) When pull-up resistors are disabled with PE set to 0 KWUPSTn can be used to specify a High level, Low level, rising edge or falling edge as the active condition for key inputs. The active condition for key inputs is constantly monitored. 2) In static pull-up mode with PE set to 1 and DPE set to 0 KWUPSTn can be used to specify a High level, Low level, rising edge or falling edge as the active condition for key inputs. The active condition for key inputs is constantly monitored. 3) In dynamic pull-up mode with PE set to 1 and DPE set to 1 The active condition for each key input (interrupt) is detected one fs clock cycle before the T1 period ends. Only edge detection is supported. Therefore, key input must be asserted for at least a period of T2. In this case, do not set the active condition to a level. There is a delay of up to T2 before detection. The following figure shows an example when the active condition is a falling edge.
Pull-up
Key Input
H or High-Z
Low for T2 or longer
H or High-Z or L
Interrupt Detection Timing Key input detected Result of Internal Sampling
TMP1942CY/CZ-337
TMP1942CY/CZ
7
KWUPST0 Bit symbol After Reset Function (0xFFFF_F360) Read/Write
6

5
KEY01 R/W 1
4
KEY00 0
3

2

1

0
KEY0EN R/W 0 KEY0 interrupt input 0: Disable 1: Enable
Sets KEY0 active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
7
KWUPST1 Bit symbol After Reset Function (0xFFFF_F361) Read/Write
6

5
KEY11 R/W 1
4
KEY10 0
3

2

1

0
KEY1EN R/W 0 KEY1 interrupt input 0: Disable 1: Enable
Sets KEY1 active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
7
KWUPST2 Bit symbol After Reset Function (0xFFFF_F362) Read/Write
6

5
KEY21 R/W 1
4
KEY20 0
3

2

1

0
KEY2EN R/W 0 KEY2 interrupt input 0: Disable 1: Enable
Sets KEY2 active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
7
KWUPST3 Bit symbol After Reset Function (0xFFFF_F363) Read/Write
6

5
KEY31 R/W 1
4
KEY30 0
3

2

1

0
KEY3EN R/W 0 KEY3 interrupt input 0: Disable 1: Enable
Sets KEY3 active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
7
KWUPST4 Bit symbol After Reset Function (0xFFFF_F364) Read/Write
6

5
KEY41 R/W 1
4
KEY40 0
3

2

1

0
KEY4EN R/W 0 KEY4 interrupt input 0: Disable 1: Enable
Sets KEY4 active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
TMP1942CY/CZ-338
TMP1942CY/CZ
7
KWUPST5 Bit symbol After Reset Function (0xFFFF_F365) Read/Write
6

5
KEY51 R/W 1
4
KEY50 0
3

2

1

0
KEY5EN R/W 0 KEY5 interrupt input 0: Disable 1: Enable
Sets KEY5 active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
7
KWUPST6 Bit symbol After Reset Function (0xFFFF_F366) Read/Write
6

5
KEY61 R/W 1
4
KEY60 0
3

2

1

0
KEY6EN R/W 0 KEY6 interrupt input 0: Disable 1: Enable
Sets KEY6 active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
7
KWUPST7 Bit symbol After Reset Function (0xFFFF_F367) Read/Write
6

5
KEY71 R/W 1
4
KEY70 0
3

2

1

0
KEY7EN R/W 0 KEY7 interrupt input 0: Disable 1: Enable
Sets KEY7 active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
7
KWUPST8 Bit symbol After Reset Function (0xFFFF_F368) Read/Write
6

5
KEY81 R/W 1
4
KEY80 0
3

2

1

0
KEY8EN R/W 0 KEY8 interrupt input 0: Disable 1: Enable
Sets KEY8 active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
7
KWUPST9 Bit symbol After Reset Function (0xFFFF_F369) Read/Write
6

5
KEY91 R/W 1
4
KEY90 0
3

2

1

0
KEY9EN R/W 0 KEY9 interrupt input 0: Disable 1: Enable
Sets KEY9 active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
TMP1942CY/CZ-339
TMP1942CY/CZ
7
KWUPSTA Bit symbol After Reset Function (0xFFFF_F36A) Read/Write
6

5
KEYA1 R/W 1
4
KEYA0 0
3

2

1

0
KEYAEN R/W 0 KEYA interrupt input 0: Disable 1: Enable
Sets KEYA active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
7
KWUPSTB Bit symbol After Reset Function (0xFFFF_F36B) Read/Write
6

5
KEYB1 R/W 1
4
KEYB0 0
3

2

1

0
KEYBEN R/W 0 KEYB interrupt input 0: Disable 1: Enable
Sets KEYB active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
7
KWUPSTC Bit symbol After Reset Function (0xFFFF_F36C) Read/Write
6

5
KEYC1 R/W 1
4
KEYC0 0
3

2

1

0
KEYCEN R/W 0 KEYC interrupt input 0: Disable 1: Enable
Sets KEYC active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
7
KWUPSTD Bit symbol After Reset Function (0xFFFF_F36D) Read/Write
6

5
KEYD1 R/W 1
4
KEYD0 0
3

2

1

0
KEYDEN R/W 0 KEYD interrupt input 0: Disable 1: Enable
Sets KEYD active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
7
KWUPCLR Bit symbol (0xFFFF_F370) Read/Write After Reset Function
6

5

4

3
KEYCLR3
2
KEYCLR2 W
1
KEYCLR1
0
KEYCLR0
Writing 1010 clears all key sources.
TMP1942CY/CZ-340
TMP1942CY/CZ
3.16 INTB, INTC, INTD, INTE
The TMP1942 supports extended interrupts INTB, INTC, INTD and INTE. These four interrupts are internally ORed and the result is input to the CG and INTC. Therefore, they represent a single interrupt source. You can determine which interrupt has actually occurred by checking the corresponding bits of INTFLG. These flags are cleared when read. * Can be used to terminate STOP/SLEEP mode (wake-up) or as an external interrupt. When used for wake-up, all four interrupts must be set collectively (in the CG block). Whether individual pins are used or not used can be specified separately (INTnST). A single interrupt source is available (INTBCDE). Rising edge, falling edge, High level, or Low level detection can be selected for individual inputs (INTnST). The interrupt source is cleared by reading INTFLG in the interrupt handling routine. Which interrupt has occurred can be determined using the INTFLG register. 7
INTBST Bit symbol After Reset Function (0xFFFF_F380) Read/Write
* * * *
6

5
INTB1 R/W 1 Sets INTB active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
4
INTB0 0
3

2

1

0
INTBEN R/W 0 INTB interrupt input 0: Disable 1: Enable
7
INTCST Bit symbol After Reset Function (0xFFFF_F381) Read/Write
6

5
INTC1 R/W 1 Sets INTC active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
4
INTC0 0
3

2

1

0
INTCEN R/W 0 INTC interrupt input 0: Disable 1: Enable
7
INTDST Bit symbol After Reset Function (0xFFFF_F382) Read/Write
6

5
INTD1 R/W 1 Sets INTD active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
4
INTD0 0
3

2

1

0
INTDEN R/W 0 INTD interrupt input 0: Disable 1: Enable
TMP1942CY/CZ-341
TMP1942CY/CZ
7
INTEST Bit symbol After Reset Function (0xFFFF_F383) Read/Write
6

5
INTE1 R/W 1 Sets INTE active condition 00: Low level 01: High level 10: Falling edge 11: Rising edge
4
INTE0 0
3

2

1

0
INTEEN R/W 0 INTE interrupt input 0: Disable 1: Enable
7
INTFLG Bit symbol After Reset Function (0xFFFF_F384) Read/Write
6

5

4

3
INTES 0
2
INTDS R 0
1
INTCS 0
0
INTBS 0
0: Interrupt 0: Interrupt 0: Interrupt 0: Interrupt not not not not generated generated generated generated 1: Interrupt 1: Interrupt 1: Interrupt 1: Interrupt generated generated generated generated
Note: Setting procedures A) When setting INT inputs first after powering up the device 1) Set the active conditions using the INTnST corresponding to the interrupt inputs to be used. 2) Clear the interrupt request by reading INTFLG. 3) Set the INTnST corresponding to the interrupt inputs to be used to 1. 4) Set the CG and INTC (refer to Section 3.4, "Interrupts" for details). B) When modifying the active condition for an INT input during operation 1) Disable INTBCD interrupts in the INTC (IMC1<26:24> = 000). 2) Modify the active condition for the INT input using the corresponding INTnST. 3) Clear the interrupt request by reading INTFLG. 4) Enable INTBCD interrupts in the INTC (set IMC1<26:24> to an appropriate level). C) When enabling an INT input during operation 1) Disable INTBCD interrupts in the INTC (IMC1<26:24> = 000). 2) Set the active condition using the INTnST corresponding to the interrupt input to be used. 3) Clear the interrupt request by reading INTFLG. 4) Set the INTnST corresponding to the interrupt input to be used to 1. 5) Enable INTBCD interrupts in the INTC (set IMC1<26:24> to an appropriate level).
TMP1942CY/CZ-342
TMP1942CY/CZ
3.17 ROM Correction Function
This section describes the ROM correction function the TMP1942 supports. The TMP1942, however, only supports the registers used for the ROM correction function. When debugging the ROM correction function, therefore, use the ROM correction circuit only to replace the contents of the registers and check subsequent operation by rewriting data in the appropriate flash memory areas. The mask ROM version of the product supports the full ROM correction function.
3.17.1
Features
* * Can replace data at four locations: 8 words for each. When the PC value or the address generated by the DMAC matches the address stored in an address register (including 5 low-order "don't care" bits), the data from the corresponding ROM correction data register located in RAM will be used in place of the ROM data at that address. ROM correction is automatically enabled by setting an address in an address register. If it is necessary to correct more than eight words in ROM, for example, when modifying a program, place a instruction for jumping to a RAM address in the data register in RAM so that you can correct data within RAM.
* *
3.17.2
Operation
By setting the physical address of a ROM area (including a projected area) in the address register ADDREGn, you can substitute the data from the data register in RAM corresponding to the ADDREGn for the ROM data at that address. Setting an address in ADDREGn automatically enables the ROM correction function. Upon a reset, the entire ROM correction function is disabled. Therefore, to perform ROM correction in the initial routine after the reset process completes, set an address in an appropriate address register. The ROM correction function is enabled for the address register(s) for which an address is set, so that ROM data will be replaced if the address matches with the value of the PC (when the CPU holds bus control) or if it matches with the source or destination address generated by the DMAC (when the DMAC holds bus control). For example, setting addresses in ADDREG0 and ADDREG3 enables ROM correction for the corresponding areas, so that an address match will constantly be monitored for these address registers and if the addresses match, ROM data will be replaced. In that case, ROM correction will not be performed for ADDREG2 and ADDREG4. Although the address registers have bits 31:5, an address match is detected only for A<18:5> to simplify the circuit. Internally, the ROMCS signal which indicates the ROM area and the match detection from the ROM correction circuit are logically ANDed. ROM correction addresses can only be specified on 8-word boundaries (that is, A0 to A4 are 0). This means data is replaced in 32-byte units. To replace only part of 32 bytes, write the same data for the addresses for which no replacement is required. The following table shows the relationship between ADDREGn and the RAM areas: Address Register
ADDREG0 ADDREG1 ADDREG2 ADDREG3
Corresponding RAM Area
0xFFFF_BF80 0xFFFF_BF9F 0xFFFF_BFA0 0xFFFF_BFBF 0xFFFF_BFC0 0xFFFF_BFDF 0xFFFF_BFE0 0xFFFF_BFFF
TMP1942CY/CZ-343
TMP1942CY/CZ
G-Bus
Contained in TMP1942FD
Address Register ADDREGn
ADDREGn write Detection and Hold Circuit
Compare Circuit
Selector
Operand Address
Instruction Address
TX19/L MPU
Conversion Circuit
Comparison
RAM
ROM
Selector
Operand Data
Instruction Data
GBIF
Figure 3.17.1 ROM Correction System Diagram
TMP1942CY/CZ-344
TMP1942CY/CZ 3.17.3 Registers
(1) Address registers 7
ADDREG0 Bit symbol After Reset Function ADD07 0 (0xFFFF_E540) Read/Write
6
ADD06 R/W 0
5
ADD05 0
4

3

2

1

0

15
Bit symbol Read/Write After Reset Function 0 ADD015
14
ADD014 0
13
ADD013 0
12
ADD012 0 R/W
11
ADD011 0
10
ADD010 0
9
ADD09 0
8
ADD08 0
23
Bit symbol Read/Write After Reset Function 0 ADD023
22
ADD022 0
21
ADD021 0
20
Add020 0 R/W
19
ADD019 0
18
ADD018 0
17
ADD017 0
16
ADD016 0
31
Bit symbol Read/Write After Reset Function 0 ADD031
30
ADD030 0
29
ADD029 0
28
ADD028 0 R/W
27
ADD027 0
26
ADD026 0
25
ADD025 0
24
ADD024 0
7
ADDREG1 Bit symbol After Reset Function ADD07 0 (0xFFFF_E544) Read/Write
6
ADD06 R/W 0
5
ADD05 0
4

3

2

1

0

15
Bit symbol Read/Write After Reset Function 0 ADD015
14
ADD014 0
13
ADD13 0
12
ADD012 0 R/W
11
ADD011 0
10
ADD010 0
9
ADD09 0
8
ADD08 0
23
Bit symbol Read/Write After Reset Function 0 ADD023
22
ADD022 0
21
ADD021 0
20
Add020 0 R/W
19
ADD019 0
18
ADD018 0
17
ADD017 0
16
ADD016 0
31
Bit symbol Read/Write After Reset Function 0 ADD031
30
ADD030 0
29
ADD029 0
28
ADD028 0 R/W
27
ADD027 0
26
ADD026 0
25
ADD025 0
24
ADD024 0
TMP1942CY/CZ-345
TMP1942CY/CZ
7
ADDREG2 Bit symbol After Reset Function ADD07 0 (0xFFFF_E548) Read/Write
6
ADD06 R/W 0
5
ADD05 0
4

3

2

1

0

15
Bit symbol Read/Write After Reset Function 0 ADD015
14
ADD014 0
13
ADD013 0
12
ADD012 0 R/W
11
ADD011 0
10
ADD010 0
9
ADD09 0
8
ADD08 0
23
Bit symbol Read/Write After Reset Function 0 ADD023
22
ADD022 0
21
ADD021 0
20
Add020 0 R/W
19
ADD019 0
18
ADD018 0
17
ADD017 0
16
ADD016 0
31
Bit symbol Read/Write After Reset Function 0 ADD031
30
ADD030 0
29
ADD029 0
28
ADD028 0 R/W
27
ADD027 0
26
ADD026 0
25
ADD025 0
24
ADD024 0
7
ADDREG1 Bit symbol After Reset Function ADD07 0 (0xFFFF_E54C) Read/Write
6
ADD06 R/W 0
5
ADD05 0
4

3

2

1

0

15
Bit symbol Read/Write After Reset Function 0 ADD015
14
ADD014 0
13
ADD13 0
12
ADD012 0 R/W
11
ADD011 0
10
ADD010 0
9
ADD09 0
8
ADD08 0
23
Bit symbol Read/Write After Reset Function 0 ADD023
22
ADD022 0
21
ADD021 0
20
Add020 0 R/W
19
ADD019 0
18
ADD018 0
17
ADD017 0
16
ADD016 0
31
Bit symbol Read/Write After Reset Function 0 ADD031
30
ADD030 0
29
ADD029 0
28
ADD028 0 R/W
27
ADD027 0
26
ADD026 0
25
ADD025 0
24
ADD024 0
Note: DMAC transfer to an address register is not supported. However, DMAC transfer to the substitution data areas allocated in RAM is supported. The ROM correction function is valid for both CPU access and DMAC access.
TMP1942CY/CZ-346
TMP1942CY/CZ
3.18 Timer for Real-Time Clock
The TMP1942 contains a timer for real-time clock. Using the 32.768-kHz low-frequency clock, the timer implements a time-keeping function by generating interrupts every 0.0625 s, 0.125 s, 0.25 s or 0.50 s. The timer for real-time clock can operate in any mode in which low-frequency oscillation is enabled. In addition, a real-time clock interrupt can be used to release the device from a standby mode (other than STOP mode). When using a real-time clock interrupt (INTRTC), set the IMCGB3 register in the CG block appropriately.
3.18.1
Configuration
Figure 3.18.1 shows a block diagram of the timer for real-time clock.
Interrupt Request INTRTC 8-bit Accumulator RUN /CLEAR 2
11
RTCCR RTCCR
Selector
2
12
2
13
2
14
RTCREG fs (32.768 kHz) 14-Stage Binary Counter
Figure 3.18.1 Block Diagram of Timer for Real-Time Clock
The timer for real-time clock can be controlled using the timer for real-time clock control register (RTCCR). Figure 3.18.2 shows the functions of this register. 7
RTCCR Bit symbol After Reset Function 0 Must always be set to 0. (0xFFFF_F0A0) Read/Write
6

5

4

3
R/W 0
Clears accumulator
2
R/W 0 00: 2 /fs 01: 2 /fs 10: 2 /fs 11: 2 /fs
11 12 13 14
1
RTCSEL0 0
0
RTCRUN R/W 0 0: Stop and clear 1: Count
RTCRCLR RTCSEL1
0: Clear 1: Don't care
Interrupt generation cycle (fs = 32.768 kHz) 00 01 10 11 0.50 s 0.25 s 0.125 s 0.0625 s
Figure 3.18.2 Timer for Real-Time Clock Control Register
TMP1942CY/CZ-347
TMP1942CY/CZ
The timer for real-time clock has an accumulator which, when set, holds a cumulative count of the timer for real-time clock interrupts which have been generated. If, for example, an interrupt generation cycle of 0.5 second is selected, this register can hold a cumulative count for up to 127.5 seconds. Accumulator 7
RTCREG Bit symbol After Reset Function RUI7 0 (0xFFFF_F0A4) Read/Write 0 0 0
6
RUI6
5
RUI5
4
RUI4 R
3
RUI3 0
2
RUI2 0
1
RUI1 0
0
RUI0 0
Accumulate count value
Figure 3.18.3 Accumulator of Timer for Real-Time Clock Each time an INTRTC interrupt is generated, the accumulator is incremented after one cycle of the fs clock. The accumulator must be read in SLOW mode. An instruction for clearing the accumulator is not accepted within one fs clock cycle after the generation of an INTRTC interrupt. To clear the accumulator, execute two clear accumulator instructions in SLOW mode.
fs Clock
INTRTC Interrupt Accumulated Counter Value
n
n+1
Instruction for clearing accumulated counter value not accepted
Example 1: Clearing the accumulator
SYSCR1 RTCCR RTCCR SYSCR1 7 x 0 0 x 6 x x x x 5 1 x x 0 4 x x 3 0 0 2 x x 1 0 1 1 Select SLOW mode. Clear accumulator twice. Restore NORMAL mode.
Example 2: Setting up a timer for real-time clock interrupt Initial settings
IMCGB3 IMCEHL EICRCG INTCLR RTCCR 7 0 0 0 0 0 6 0 0 0 0 0 5 1 0 0 1 0 4 1 1 0 1 0 3 0 0 0 1 1 2 0 X 1 0 X 1 0 X 1 1 X 0 1 X 1 0 1 Set interrupt level. Clear interrupt request for CG block. Clear interrupt request for INTC block. Start timer counting.
INTRTC interrupt
EICRCG INTCLR Processing End of interrupt 76543210 00000111 00111010 Clear interrupt request for CG block. Clear interrupt request for INTC block.
Note 1: X = Don't care Note 2: To disable interrupts, set IMCEHL before setting IMCGB3.
TMP1942CY/CZ-348
TMP1942CY/CZ
3.19 Watchdog Timer (Runaway Detection Timer)
The TMP1942 contains a watchdog timer for the purpose of runaway detection. When the CPU starts operating erratically (runaway) due to noise or other causes, the watchdog timer (WDT) detects this runaway condition to re-establish a normal condition. Upon detecting a runaway condition, the watchdog timer notifies the CPU by generating a non-maskable interrupt. Also, output from the watchdog timer can be transmitted to a reset input (internal to the chip) in order to forcibly reset the device.
3.19.1
Configuration
Figure 3.19.1 shows a block diagram of the watchdog timer.
WDMOD
RESET Pin
Reset Controller
Internal Reset
Interrupt Request INTWD WDMOD 2
15
Selector
17 19 21
2
2
2
fSYS/2
Binary Counter (22 stages) Reset
Q R S
Internal Reset WDMOD
Write 4EH
Write B1H
Watchdog Timer Control Register WDCR
Internal Data Bus
Figure 3.19.1 Watchdog Timer Block Diagram
TMP1942CY/CZ-349
TMP1942CY/CZ
The watchdog timer consists of a 22-stage binary counter clocked by the system clock fsys/2. Four binary counter outputs are available: 215, 217, 219 and 221. Any one of these counter outputs can be selected using WDMOD, so that when the selected counter output overflows, a watchdog timer interrupt will be generated, as shown in Figure 3.19.2.
n
WDT Counter
Overflow
0
WDT Interrupt Write Clear Code WDT Clear (Software)
Figure 3.19.2 Normal Mode Also, it is possible to reset the chip itself when the counter output overflows. In this case, the chip is reset for a period of 22 to 29 states as shown in Figure 3.19.3. When the chip is reset in this way, the watchdog timer is clocked by a clock of fsys, instead of by the afore-mentioned input clock fsys/2. The fsys clock is derived by dividing the high-speed oscillator's clock fC by a clock gear of 8.
Overflow WDT Counter n
WDT Interrupt
Internal Reset 22 to 29 states (8.8~11.6 s @ fC = 40 MHz, fsys = 5 MHz, fsys/2 = 2.5 MHz)
Figure 3.19.3 Reset Mode Note: Even when the chip is reset by the watchdog timer, the PLLOFF pin is sampled. Thus, the PLLOFF pin must be held at a constant logic level, either High or Low.
TMP1942CY/CZ-350
TMP1942CY/CZ 3.19.2 Control Registers
The watchdog timer (WDT) can be controlled using two control registers (WDMOD and WDCR). (1) Watchdog timer mode register (WDMOD) a. Setting the watchdog timer detection time (WDTP1:WDTP0) These two bits are used to set the watchdog timer interrupt detection time necessary for detecting a runaway condition. Upon a reset, WDMOD are initialized to 00. Figure 3.19.4 shows watchdog timer detection times. b. Enabling/disabling the watchdog timer (WDTE) Upon a reset, WDMOD is initialized to 1, enabling the watchdog timer. To disable the watchdog timer, set this bit to 0 and, at the same time, write the disable code (B1H) to the WDCR register. This dual setting ensures that the watchdog timer cannot easily be disabled by a runaway condition. To re-enable the watchdog timer after it has been disabled, simply set the WDMOD bit to 1. c. Connecting the watchdog timer output to reset (RESCR) This bit is used to specify whether or not the CPU itself will be reset upon the detection of a runaway condition. Upon a reset, WDMOD is initialized to 0. When WDMOD = 0, the CPU will not be reset by the watchdog timer output. (2) Watchdog timer control register (WDCR) This register controls the watchdog timer by disabling the watchdog timer function and clearing the binary counter. * Disabling the watchdog timer
The watchdog timer can be disabled by setting WDMOD to 0 and then writing the disable code (B1H) to the WDCR register.
WDMOD WDCR 0- - - - - - - 10110001 Clear WDTE to 0. Write disable code (B1H).
*
Enabling the watchdog timer Set WDMOD to 1.
*
Clearing the binary counter
Writing the clear code (4EH) to the WDCR register clears the binary counter and restarts counting.
WDCR 01001110 Write clear code (4EH).
Note:
Writing the disable code (B1H) causes the binary counter to be cleared.
TMP1942CY/CZ-351
TMP1942CY/CZ
7
WDMOD Bit symbol After Reset Function WDTE R/W 1 Controls WDT 1: Enable (0xFFFF_F090) Read/Write
6
WDTP1 R/W 0
5
WDTP0 0
4

3

2
I2WDT R/W 0 IDLE
1
RESCR 0
0
R/W 0
Selects WDT detection time 00: 2 /fSYS 01: 2 /fSYS 10: 2 /fSYS 11: 2 /fSYS
22 20 18 16
1: Transmits Must WDT always be 0: Idle output to set to 0. 1: Operate chip's internal reset pin
Controls watchdog timer output 0 1 Transmit WDT output to reset
Watchdog timer detection time
@ fc = 32 MHz, fs = 32.768 kHz
SYSCR1 SYSCR1 System Clock Clock Gear Selection Value
1 (fs) xxx 00 (fc) 0 (fc) 01 (fc/2) 10 (fc/4) 11 (fc/8)
Watchdog Timer Detection Time WDMOD 00
2.0 s 2.048 ms 4.096 ms 8.192 ms 16.384 ms
01
8.0 s 8.192 ms 16.384 ms 32.768 ms 65.536 ms
10
32.0 s 32.768 ms 65.536 ms 131.072 ms 262.144 ms
11
128.0 s 131.072 ms 262.144 ms 524.288 ms 1048.576 ms
Disables/enables watchdog timer 0 1 Disable Enable
Figure 3.19.4 Watchdog Timer Mode Register
7
WDCR Bit symbol After Reset Function (0xFFFF_F091) Read/Write
6
5
4
W
3
2
1
0
B1H: WDT disable code 4EH: WDT clear code
Disables or clears WDT Disable code B1H 4EH Other values Clear code
Figure 3.19.5 Watchdog Timer Control Register
TMP1942CY/CZ-352
TMP1942CY/CZ 3.19.3 Functional Description
After the detection time which has been set in WDMOD, the watchdog timer generates an interrupt (INTWDT). The binary counter for the watchdog timer must be cleared to zero by software before an INTWDT interrupt can occur. If runaway occurs in the CPU due to noise or other causes, and prevents the CPU from executing the instruction to clear the binary counter, the binary counter will overflow and generate an INTWDT interrupt. This interrupt notifies the CPU that it has gone out of control, so that the CPU can restore itself to a normal condition by executing a program to correct the runaway condition. Also, output from the watchdog timer can be transmitted to the reset pin or other pins of peripheral devices to address the CPU runway condition. The watchdog timer will start operating as soon as the device has completed its reset sequence. In SLEEP and STOP modes, the watchdog timer is reset and remains idle. If the bus is free ( BUSAK = Low), it will continue to count. In IDLE mode, the WDMOD setting determines whether the watchdog timer is on or off. Before placing the device into IDLE mode, set WDMOD as required.
Examples: 1) Clearing the binary counter
76543210 WDCR 01001110 Write clear code (4EH).
2) Setting the watchdog timer detection time to 218/fsys
76543210 WDMOD 101- - - - -
3) Disabling the watchdog timer
WDMOD WDCR 76543210 0- - - - - - - 10110001 Clear WDTE to 0. Write disable code (B1H).
TMP1942CY/CZ-353
TMP1942CY/CZ
4 Electrical Characteristics
4.1 Absolute Maximum Ratings
The letter x in equations presented in this chapter represents the cycle period of the fsys clock selected through the programming of the SYSCR1.SYSCK bit. The fsys clock may be derived from either the high-speed or low-speed crystal oscillator. The programming of the clock gear function also affects the fsys frequency. All relevant values in this chapter are calculated with the high-speed (fc) system clock (SYSCR1.SYSCK=0) and a clock gear factor of 1/fc (SYSCR1.GEAR[1:0]=00).
Parameter Supply voltage
Symbol VCC3 VCC5
Rating - 0.5~4.0 - 0.5~6.0 - 0.5~VCC3 + 0.5 - 0.5~ VCC5+ 0.5 - 0.5~ AVCC+ 0.5 - 0.5~ AVCC+ 0.5 - 0.5~ DAVCC+ 0.5 5 80 -5 -80 600 260 -65~150 -40~85
Unit V V V V V V V
Input voltage
VIN3 VIN5(Note)
Low-level output current Analog input
VAIN VAREFH DAREFH
Low-level output current
Per pin Total Per pin
IOL IOL IOH IOH PD TSOLDER TSTG TOPR
mA
High-level output current Total Power dissipation (Ta = 85C) Soldering temperature (10 s) Storage temperature Operating temperature
mW C C C
VCC3= DVCC3 = AVCC=DAVCC=CVCC , VCC5=DVCC51=DVCC52 VSS =DVSS = AVSS= DAVSS =CVSS Note : PortC , PortF
Note: Maximum ratings are limiting values of operating and environmental conditions which should not be exceeded under the worst possible conditions. The equipment manufacturer should design so that no maximum rating value is exceeded with respect to current, voltage, power dissipation, temperature, etc. Exposure to conditions beyond those listed above may cause permanent damage to the device or affect device reliability, which could increase potential risks of personal injury due to IC blowup and/or burning.
TMP1942CY/CZ-354
TMP1942CY/CZ
4.2 DC Electrical Characteristics (1/4)
Ta=-40~85C
Parameter Symbol Condition
fosc = 5~8MHz fsys = 2.5~32MHz fs = 30~34kHz fosc = 5~7MHz fsys = .5~28MHz fs = 30~34kHz (INTLV="H") fosc = 10~20MHz fsys = 1~20MHz fs = 30~34kHz (INTLV="L") fosc = 10~16MHz fsys = 1~16MHz fs = 30~34kHz fosc = 20~32MHz fsys = 1.25~16MHz fs = 30~34kHz = "0" fosc = 10~16MHz fsys = 1~16MHz fs = 30~34kHz
Min
Typ
(Note 1)
Max
Unit
3.0
PLLON (INTLV="H")
2.7
DVCC3 Supply voltage DAVCC=AVCC =CVCC=DVCC3 DAVSS=AVSS =CVSS= 0V
PLLOFF (Crystal)
2.7
3.6 V
PLLOFF (External clock)
3.0
2.7
Low-level input voltage
P00~P17(AD0~15) P20~PB7 ,PD0~PE7
DVCC5* (Note 2) VIL VIL1 VIL2 VIL3 VIL4 VIH VIH1 VIH2 VIH3 VIH4 VOL VOH1
fsys = 1~32MHz fs = 30~34kHz
4.5
5.25 0.6 0.3DVCC3
PLLOFF ,BW0 ,BW1,
RSTPUP , RESET , NMI PC0~PC7 ,PF0~PF6 X1 P00~P17(AD0~15) P20~PB7 ,PD0~PE7
- 0.3
0.2 DVCC3 0.3 DVCC5 0.2 DVCC3
High-level input voltage
DVCC32.7V DVCC54.5V
2.0 0.7DVCC3 0.8DVCC3 0.7DVCC5 0.8DVCC3 DVCC5 + 0.3 DVCC3 + 0.3 0.45 2.4 2.4 4.2 DVCC3 + 0.3
V
PLLOFF ,BW0 ,BW1 ,
RSTPUP , RESET , NMI PC0~PC7 ,PF0~PF6 X1
Low-level output voltage
IOL = 1.6mA
DVCC32.7V DVCC54.5V DVCC32.7V
V
High-level output voltage
VOH2 (Note3)
IOH = - 400 A
DVCC52.7V DVCC54.5V
Note 1: VCC3 = 3.3 V, VCC5 = 5.0 V, Ta = 25C, unless otherwise noted. Note 2: DVCC5*:DVCC51,DVCC52 DVCC5*can be used also as 2.7VDVCC5*3.6V. Note 3: PortC,PortF
TMP1942CY/CZ-355
TMP1942CY/CZ
4.3 DC Electrical Characteristics (2/4)
Ta=-40~85C
Parameter
Input leakage current Output leakage current Power-down voltage (STOP mode, RAM backup)
Symbol
ILI ILO VSTOP1 VSTOP2 RRST PKH1 PKH2 CIO
Condition
0.0 VIN D VCCn (n=3,5) 0.2 VIN DVCCn - 0.2(n=3,5) VIL2 = 0.2DVCC3 VIH2 = 0.8DVCC3 VIL2 = 0.2DVCC5 VIH2 = 0.8DVCC5 VCC = 3.3V 0.3V DVCC3 = 3.3V 0.3V DVCC5 = 4.5V~5.25V fc = 1MHz
Min
Typ (Note )
0.02 0.05
Max
5 10 3.6
Unit
A
2.2 VSTOP1 100 30 30 45 55
V 5.25 550 100 100 10 k k
Pull-up resistor at Reset Programmable pull-up resistor P32~P37,P40~P43 KEY0~KEYD Pin capacitance (except power/ground pins)
pF
Note: VCC3 = 3.3 V, VCC5 = 5.0 V, Ta = 25C, unless otherwise noted.
TMP1942CY/CZ-356
TMP1942CY/CZ
4.4 DC Electrical Characteristics (3/4)
(1) TMP1942CYUE
DVCC3=3.3V0.3V , DVCC51= DVCC52 = 3.3V0.3V ,Ta=-40~85C Parameter
NORMAL (Note2) Gear=1/1 IDLE(Doze) IDLE(Halt) NORMAL (Note2) Gear=1/1 IDLE(Doze) IDLE(Halt) SLOW SLEEP STOP ICC
Symbol
(f
OSC
Condition
fsys = 32MHz = 8MHz , PLLON) INTLV="H" fsys = 16MHz (f = 16MHz, PLLOFF) OSC INTLV="L" fs = 32.768kHz fs = 32.768kHz DVCC3 = 2.7~3.6V DVCC5 = 2.7~3.6V
Min
Typ (Note1)
70 22 20 44 11 10 50 8 1
Max
90 34 30 58 15 13 120 60 50
Unit
mA
mA A A A
Note1: VCC3 = 3.3 V, VCC5 = 5.0 V, Ta = 25C, unless otherwise noted. Note2: The measurement conditions of Icc NORMAL CPU:Dhrystone(Ver.2.1)(There is external memory access) 8bit Timer:500kHz/50%Outputx3ch,50kHz/50%Outputx3ch 16 bit Timer:500kHz/50%Outputx3ch,50kHz/50%Outputx3ch,2ms Interval Timerx6ch,2-phase pulse input counterx2ch SIO:UART(11.5kbps)x1ch,I/O interface mode (50kHz)x4ch ADC:Fixed channel, Continuous conversion DAC:Output(0x200)x3ch Note3: The measurement conditions of Icc SLOW,Icc SLEEP CPU:Equivalent to NORMAL mode Timer for Real-Time clock, 2-pulse input counter, Dynamic pull-up mode (16ms cycle, 250us sampling) Note4: The supply current flowing through the DVCC3, DVCC5, CVCC, AVCC and DAVCC pins is include in the digital supply current parameter (ICC). Note5: The supply current flowing through the A/D and D/A converter is include in the refarence current parameter (ICC Normal).
TMP1942CY/CZ-357
TMP1942CY/CZ (2) TMP1942CZUE/XB
DVCC3=3.3V0.3V , DVCC51= DVCC52 = 3.3V0.3V ,Ta=-40~85C Min. Typ. (Note1)
70 22 20 40 11 10 50 8 1 90 34 30 58 15 13 120 60 50 A A A mA mA
Parameter
NORMAL (Note2) Gear=1/1 IDLE(Doze) IDLE(Halt) NORMAL (Note2) Gear=1/1 IDLE(Doze) IDLE(Halt) SLOW SLEEP STOP
Symbol
Condition
fsys = 32MHz (f
OSC
Max.
Unit
= 8MHz , PLLON)
INTLV="H" fsys = 16MHz ICC (f = 16MHz, PLLOFF) OSC INTLV="L" fs = 32.768kHz fs = 32.768kHz DVCC3 = 2.7~3.6V DVCC5 = 2.7~3.6V
Note1: VCC3 = 3.3 V, VCC5 = 5.0 V, Ta = 25C, unless otherwise noted. Note2: The measurement conditions of Icc NORMAL CPU:Dhrystone(Ver.2.1)(There is external memory access) 8bit Timer:500kHz/50%Outputx3ch,50kHz/50%Outputx3ch 16 bit Timer:500kHz/50%Outputx3ch,50kHz/50%Outputx3ch,2ms Interval Timerx6ch,2-phase pulse input counterx2ch SIO:UART(11.5kbps)x1ch,I/O interface mode (50kHz)x4ch ADC:Fixed channel, Continuous conversion DAC:Output(0x200)x3ch Note3: The measurement conditions of Icc SLOW,Icc SLEEP CPU:Equivalent to NORMAL mode Timer for Real-Time clock, 2-pulse input counter, Dynamic pull-up mode (16ms cycle, 250us sampling) Note4: The supply current flowing through the DVCC3, DVCC5, CVCC, AVCC and DAVCC pins is include in the digital supply current parameter (ICC). Note5: The supply current flowing through the A/D and D/A converter is include in the refarence current parameter (ICC Normal).
TMP1942CY/CZ-358
TMP1942CY/CZ
4.5 DC Electrical Characteristics (4/4)
(1) TMP1942CYUE
DVCC3=3.3V0.3V , DVCC51= DVCC52 = 5.0V0.25V ,Ta=-40~85C Parameter Symbol
(f NORMAL Gear=1/1 ICC SLOW SLEEP STOP
Condition
fsys = 32MHz
OSC
Min
Typ (Note1)
70
Max
90
Unit
mA
= 8MHz , PLLON) INTLV="H"
fsys = 16MHz (f = 16MHz , PLLOFF) OSC INTLV="L" fs = 32.768kHz fs = 32.768kHz DVCC3 = 2.7~3.6V DVCC5 = 4.75~5.25V 44 58 mA
50 8 1
120 60 50
A
A
Note1: Note1: VCC3 = 3.3 V, VCC5 = 5.0 V, Ta = 25C, unless otherwise noted. Note2: The measurement conditions of Icc NORMAL: Please refer to 4.4 DC Electrical Characteristics (3/4) Note2
and Note3.
Note3: An electroc current to use in CVCC, AVCC and DAVCC is inncluded in DVCC3(ICC). Note4: An electroc current to use in DVCC51 and DVCC52 is inncluded in DVCC5(ICC).
(2) TMP1942CZUE/XB
DVCC3=3.3V0.3V , DVCC51= DVCC52 = 5.0V0.25V ,Ta=-40~85C Parameter Symbol
(f NORMAL Gear=1/1 ICC SLOW SLEEP STOP
Condition
fsys = 32MHz
OSC
Min
Typ (Note1)
70
Max
90
Unit
mA
= 8MHz , PLLON) INTLV="H"
fsys = 16MHz (f = 16MHz , PLLOFF) OSC INTLV="L" fs = 32.768kHz fs = 32.768kHz DVCC3 = 2.7~3.6V DVCC5 = 4.75~5.25V 44 58 mA
50 8 1
120 60 50
A
A
Note1: Note1: VCC3 = 3.3 V, VCC5 = 5.0 V, Ta = 25C, unless otherwise noted. Note2: The measurement conditions of Icc NORMAL: Please refer to 4.4 DC Electrical Characteristics (3/4) Note2
and Note3.
Note3: An electroc current to use in CVCC, AVCC and DAVCC is inncluded in DVCC3(ICC). Note4: An electroc current to use in DVCC51 and DVCC52 is inncluded in DVCC5(ICC).
TMP1942CY/CZ-359
TMP1942CY/CZ
4.6 10bit A/D Converter Electrical Characteristics
(1) TMP1942CYUE Ta=-40~85C
Parameter
Reference ( + ) Reference ( - ) Analog input Conversion Reference current No conversion Analog input capacitance Analog input impedance INL error DVCC3 = AVCC = VREFH = 3.3V 0.3V DVSS = AVSS = VREFL AIN resistance<5 AIN load capacitance<50pF AVCC load capacitance10F VREFH load capacitance10F Conversion time2s (Scan mode) Conversion time4s (Single mode) IREF
Symbol
VREFH VREFL VAIN
Condition
Min
2.7 AVCC- 0.3 AVSS VREFL
Typ
AVCC AVSS
Max
3.6 AVCC+ 0.3 AVSS + 0.2 VREFH
Unit
V V V mA
DVCC3 = AVCC = VREFH = 3.3V 0.3V DVSS = AVSS = VREFL DVCC3 = AVCC = VREFH = 2.7~3.6V DVSS = AVSS = VREFL
2
2.5
0.02
5 20 5 2. 5
A pF k LSB

DNL error
2
LSB
Offset error
4
LSB
Gain error
4
LSB
Note1: 1LSB = (VREFH - VREFL) / 1024[V] Note2: The A/D converter must be stopped when operating the TMP1942 with the low-speed clock (fs). Note3: The supply current flowing through the AVCC pin is included in the digital supply current parameter (ICC).
TMP1942CY/CZ-360
TMP1942CY/CZ
(2) TMP1942CZUE/XB Ta=-40~85C
Parameter
Reference ( + ) Reference( - ) Analog input Conversion Reference current No conversion Analog input capacitance Analog input impedance INL error IREF
Symbol
VREFH VREFL VAIN
Condition
Min
2.7 AVCC- 0.3 AVSS VREFL
Typ
AVCC AVSS
Max
3.6 AVCC+ 0.3 AVSS + 0.2 VREFH
Unit
V V V mA
DVCC3 = AVCC = VREFH = 3.3V 0.3V DVSS = AVSS = VREFL DVCC3 = AVCC = VREFH = 2.7~3.6V DVSS = AVSS = VREFL
2.2
2.85
0.02
5 20 5
A pF k LSB

DVCC3 = AVCC = VREFH = 3.3V 0.3V DVSS = AVSS = VREFL AIN resistance<5 AIN load capacitance<50pF AVCC load capacitance10F VREFH load capacitance10F Conversion time2s (Scan mode) Conversion time4s (Single mode)
2. 5
DNL error
2
LSB
Offset error
4
LSB
Gain error
4
LSB
Note1: 1LSB = (VREFH - VREFL) / 1024[V] Note2: The A/D converter must be stopped when operating the TMP1942 with the low-speed clock (fs). Note3: The supply current flowing through the AVCC pin is included in the digital supply current parameter (ICC).
TMP1942CY/CZ-361
TMP1942CY/CZ
4.7 10bit D/A Converter Electrical Characteristics
Ta=-40~85C
Parameter
Reference ( + )
Symbol
DAREFH
Condition
Min
2.7 DAVCC - 0.3
Typ
DAVCC 0.6
Max
3.6 DAVCC+0.3 1
Unit
V V mA
= 1 Reference current = 0 IDREF
DVCC3 = DAVCC = DAREFH = 3.3V 0.3V DVSS = DAVSS DVCC3 = DAVCC = DAREFH = 2.7~3.6V DVSS = DAVSS
0.02
5
A
Output current
IDAOUT
DVCC3 = DAVCC = DAREFH = 2.7~3.6V DVSS = DAVSS DVCC3 = DAVCC = DAREFH = 2.7~3.6V DVSS = DAVSS DVCC3 = DAVCC = DAREFH = 3.3V 0.3V DVSS = DAVSS
1
1.5
mA
Outpu voltage range
DAOUT
DAVSS+0.3
DAVCC-0.3
V
Gain error
1
3
LSB
Note1: 1LSB = (DAREFH - DAVSS) / 1024[V] Note2: The D/A converter must be stopped when operating the TMP1942 with the low-speed clock (fs). Note3: The supply current flowing through the DAVCC pin is included in the digital supply current parameter (ICC). Note4: IDREF electoric current value is an electoric current value when I moved three D/A converter.
TMP1942CY/CZ-362
TMP1942CY/CZ
4.8 AC Electrical Characteristics
(1) VCC = 3.0~3.6 V, Ta = 0~70C, ALE = 0.5 clock cycle (recommended when tSYS is 50 ns or longer) No.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Parameter
System clock period (x) A0-A15 valid to ALE low A0-A15 hold after ALE low ALE pulse width high ALE low to RD or WR asserted
Symbol
tSYS tAL tLA tLL tLC tCL tACL tACH tCAR tADL tADH tRD tRR tHR tRAE tWW tDW tWD tAWH tAWL tCW
Equation Min
31.25 0.4x - 12 0.4x - 8 0.4x - 6 0.4x -8 x - 15 x - 20 x - 20 x - 15 x (2 + W) - 42 x (2 + W) - 42 x (1 + W) - 28 x (1 + W) - 10 0 x - 15 x (1 + W) - 10 x (1 + W) - 18 x - 15 1.5x - 30 1.5x - 30 (0.5 + N - 1) x +2 (0.5 + N) x - 17
20 MHz(fsys)* Max
33333
Min
50 8 12 14 12 35 30 30 35
Max
Unit
ns ns ns ns ns ns ns ns ns
RD or WR negated to ALE high
A0-A15 valid to RD or WR asserted A0-A23 valid to RD or WR asserted A0-A23 hold after RD or WR negated A0-A15 valid to D0-D15 data in A0-A23 hold after RD or WR negated
58 58 22 40 0 35 40 32 35 45 45 27 58
ns ns ns ns ns ns ns ns ns ns ns ns
RD asserted to D0-D15 data in
RD width low
D0-D15 hold after RD negated
RD negated to next A0-A15 output
WR width low
D0-D15 valid to WR negated D0-D15 hold after WR negated A0-A23 valid to WAIT input A0-A15 valid to WAIT input
WAIT hold after RD or WR asserted
*WAIT = 0 AC measurement conditions: * Output levels: High = 2.4 V, Low = 0.45 V, CL = 30 pF * Input levels: High = 2 V, Low = 0.6 V W: Number of wait-state cycles inserted (0 to 7 for programmed wait insertion) N : Value of N for (1 + N) wait insertion
TMP1942CY/CZ-363
TMP1942CY/CZ
(2)VCC = 3.0 ~ 3.6 V, Ta = 0 ~ 70C, ALE = 1.5 clock cycles No.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Parameter
System clock period (x) A0-A15 valid to ALE low A0-A15 hold after ALE low ALE pulse width high ALE low to RD or WR asserted
Symbo l
tSYS tAL tLA tLL tLC tCL tACL tACH tCA tADL tADH tRD tRR tHR tRAE tWW tDW tWD tAWH tAWL tCW
Equation Min
31.25 1.4x - 12 0.4x - 8 1.4x - 6 0.4x - 8 x - 15 2x - 20 2x - 20 x - 15 x (3 + W) - 42 x (3 + W) - 42 x (1 + W) - 28 x (1 + W) - 10 0 x - 15 x (1 + W) - 10 x (1 + W) - 18 x - 15 2.5x - 30 2.5x - 30 (0.5 + N - 1) x +2 (0.5 + N) x - 17
32 MHz(fsys)* Max
33333 31 4 37 4 16 42 42 16 51 51 3 21 0 16 21 13 16 48 48 18 29
Min
Max
Unit
ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
RD or WR negated to ALE high
A0-A15 valid to RD or WR asserted A0-A23 valid to RD or WR asserted A0-A23 hold after RD or WR negated A0-A15 valid to D0-D15 data in A0-A23 valid to D0-D15 data in
RD asserted to D0-D15 data in RD width low
D0-D15 hold after RD negated
RD negated to next A0-A15 output WR width low
D0-D15 valid to WR negated D0-D15 hold after WR negated A0-A23 valid to WAIT input A0-A15 valid to WAIT input
WAIT hold after RD or WR asserted
*WAIT = 0 AC measurement conditions: * Output levels: High = 2.4 V, Low = 0.45 V, CL = 30 pF * Input levels: High = 2 V, Low = 0.6 V W: Number of wait-state cycles inserted (0 to 7 for programmed wait insertion) N : Value of N for (1 + N) wait insertion
TMP1942CY/CZ-364
TMP1942CY/CZ
(1) Read Cycle Timing (ALE = 1.5,No-Wait)
4CLK/1BUS Cycle
Internal CLK S0 tLL ALE tAL tCL S1 S2 S3 S0
tLA AD0~15 A015 tADL tADH AD16~23 tACH tACL tLC tRR tRD tCAR tRAE tHR D015
RD
CS0 ~ 3
R/W
TMP1942CY/CZ-365
TMP1942CY/CZ
(2) Read Cycle Timing (ALE = 1.5,1-Wait (Internal wait) )
5CLK/1BUS Cycle
Internal CLK S0 tLL ALE tAL tCL S1 W1 S2 S3 S0
tLA AD0~15 A015 tADL tADH A16~23 tACH tACL tLC tRR tRD tCAR tRAE tHR D015
RD
CS0 ~ 3
R/W
TMP1942CY/CZ-366
TMP1942CY/CZ
(3) Read Cycle Timing (ALE = 1.5.2-Wait (External N = 1) )
6CLK/1BUS Cycle
Internal CLK
S1
W
W
S2
S3
S0
ALE
AD0~15
A015
D015
AD16~23
RD
tCW CS0 ~ 3
R/ W tAWL/H
WAIT
Note: If tAWH and/or tAWL cannot be satisified, a bus cycle must be initiated with the WAIT pin asserted.
TMP1942CY/CZ-367
TMP1942CY/CZ
(4) Write Cycle Timing (ALE = 1.5,No-Wait)
4CLK/1BUS Cycle Internal CLK tLL ALE tAL tCL
tLA AD0~15 A015 D015 tDW tACH tACL tLC tWW tCAR tWD
AD16~23
WR , HWR
CS0 ~ 3
R/W
TMP1942CY/CZ-368
TMP1942CY/CZ
SIO Timing
(1) I/O Interface Mode
In the tables below, the letter x represents the fsys cycle period, which varies, depending on the programming of the clock gear function. 1. SCLK Input Mode(SIO0,SIO1,SIO3,SIO4) Parameter
SCLK period TxD data to SCLK rise or fall TxD data hold after SCLK rise or fall* RxD data valid to SCLK rise or fall* RxD data hold after SCLK rise or fall*
Sym bol
tSCY tOSS tOHS tSRD tHSR
Equation Min
16x (tSCY/2) - 5x - 23 (tSCY/2) + 3x 2x + 8 0
20 MHz Max Min
800 127 550 108 0
32 MHz Min
500 72 343 70 0
Max
Max
Unit
ns ns ns ns ns
SIO5(DVCC51=2.7V~3.6V or 4.5V~5.25V) Parameter
SCLK period TxD data to SCLK rise or fall TxD data hold after SCLK rise or fall* RxD data valid to SCLK rise or fall* RxD data hold after SCK rise
Sym bol
tSCY tOSS tOHS tSRD tHSR
Equation Min
16x (tSCY/2) - 5x - 23 (tSCY/2) + 3x 2x + 8 0
20 MHz Max Min
800 127 550 108 0
32 MHz Min
500 72 343 70 0
Max
Max
Unit
ns ns ns ns ns
Note *: SCLK rise or fall: Measured relative to the programmed active edge of SCLK.
TMP1942CY/CZ-369
TMP1942CY/CZ
2. SCLK Output Mode (SIO0,SIO1,SIO3,SIO4) Parameter
SCLK period (programmable) TxD data to SCLK rise TxD data hold after SCLK rise RxD data valid to SCK rise RxD data hold after SCK rise
Sym bol
tSCY tOSS tOHS tSRD tHSR
Equation Min
16x (tSCY/2) - 15 (tSCY/2) - 15 x + 23 0
20 MHz Max Min
800 385 385 73 0
32 MHz Min
500 235 235 54 0
Max
Max
Unit
ns ns ns ns ns
(SIO5 DVCC51=2.7V~3.6V or 4.5V~5.25V) Parameter
SCLK period (programmable) TxD data to SCLK rise TxD data hold after SCLK rise RxD data valid to SCK rise RxD data hold after SCK rise
Sym bol
tSCY tOSS tOHS tSRD tHSR
Equation Min
16x (tSCY/2) - 15 (tSCY/2) - 15 x + 23 0
20 MHz Max Min
800 385 385 73 0
32 MHz Min
500 235 235 54 0
Max
Max
Unit
ns ns ns ns ns
SCLK SCK Output Mode / Active-High SCL SCLK Active-Low SCK Input Mode OUTPUT DATA TxD
tSCY
tOSS 0 tSRD 1
tOHS 2 tHSR 1 VALID 2 VALID 3 VALID 3
INPUT DATA RxD
0 VALID
TMP1942CY/CZ-370
TMP1942CY/CZ
4.9 SBI Timing (1) I2C mode
In the table below, the letters x and T represent the fsys and T0 cycle periods, respectively. The letter n denotes the value of n programmed into the SCK[2:0] (SCL output frequency select) field in the SBI0CR1. Parameter
SCL clock frequency Hold time for START condition Low period of the SCL clock (Note 1) SCL clock high width
Symbol
tSCL tHD:STA tLOW tHIGH
Equation Min
0
Standard Mode Fast Mode fsys = 8 MHz, n = 4 fsys = 32 MHz, n = 4 Unit Min
0 4.0 4.7 4.0
Max
Max
100
Min
0 0.6 1.3 0.6 0.6 0 100 0.6 1.3
Max
400 kHz s s s s s ns s s
Setup time for a repeated START tSU;STA condition Data hold time(Input)(Note3,4) Data setup time Setup time for STOP condition tHD;DAT tSU;DAT tSU;STO
Software (Note 5)
4.7 0 250 4.0
Bus free time between STOP and tBUF START conditions
Software (Note 5)
4.7
Note1: SCL clock low width (output) is calculated with (2 (n - 1) + 4)T. Standard mode: 6 sec @ Typ (fsys = 8 MHz, n = 4) Fast mode: 1.5sec @ Typ (fsys = 32 MHz, n = 4) Note2: SCL clock high width (output) is caluculated with (2 (n - 1))T. Standard mode: 4 sec @ Typ (fsys = 8 MHz, n = 4) Fast mode: 1sec @ Typ (fsys = 32 MHz, n = 4) Note3: The output data hold time is equal to 12X. Note4: The Philips I2C-bus specification states that a device must internally provide a hold time of at least 300 ns for the SDA signal to bridge the undefined region of the fall edge of SCL. However,TMP1942CY/CZ SBI does not satisfy this requirement. Also, the output buffer for SCL does not incorporate slope control of the falling edges; therefore, the equipment manufacturer should design so that the input data hold time shown in the table is satisfied, including tr/tf of the SCL and SDA lines. Note5: Software-dependent.
tSCL tf SCL tHD;STA SDA S S: START condition Sr: Repeated START condition P; STOP condition Sr P tSU;DAT tHD;DAT tSU;STA tSU;STO tBUF tLOW tr tHIGH
Note6: To operate the SBI in I2C Fast mode, the fysy frequency must be no less than 20 MHz. To operate the SBI in I2C Standard mode, the fysy fewquency must be no less than 4 MHz.
TMP1942CY/CZ-371
TMP1942CY/CZ
(2) Clock-Synchronous 8-Bit SIO Mode In the tables below, the letters x and T represent the fsys and T0 cycle periods, respectively. The letter n denotes the value of n programmed into the SCK[2:0] (SCL output frequency select) field in the SBI0CR1. The electrical specifications below are for an SCK signal with a 50% duty cycle. 3. SCK Input Mode (DVCC51=2.7V~3.6V or 4.5V~5.25V) Parameter
SCK period SO data to SCK rise SO data hold after SCK rise SI data valid to SCK rise SI data hold after SCK rise
Symbol
tSCY tOSS tOHS tSRD tHSR
Equation Min
16x (tSCY/2) - (6x + 30) (tSCY/2) + 4x 0 4x + 10
32 MHz Max Min
500 34 374 0 134
Max
Unit
ns ns ns ns ns
4. SCK Output Mode (DVCC51=2.7V~3.6V or 4.5V~5.25V) Parameter
SCK period (programmable) SO data to SCK rise SO data hold after SCK rise SI data valid to SCK rise SI data hold after SCK rise
Symbol
tSCY tOSS tOHS tSRD tHSR
Equation Min
2 /T (tSCY/2) - 20 (tSCY/2) - 20 2x + 30 0
n
32 MHz Max Min
1000 480 480 92 0
Max
Unit
ns ns ns ns ns
tSCY SCLK tOSS OUTPUT DATA TxD 0 tSRD INPUT DATA TxD 0 VALID 1 VALID 1 tHSR 2 VALID 3 VALID tOHS 2 3
TMP1942CY/CZ-372
TMP1942CY/CZ
4.10
Event Counters
In the table below, the letter x represents the fsys cycle period. Parameter Symbol
tVCKL tVCKH
Equation Min
2X + 100 2X + 100
32 MHz Min
163 163
Max
Max
Unit
ns ns
Clock low pulse width Clock high pulse width
4.11
Timer Capture
In the table below, the letter x represents the fsys cycle period Parameter Symbol
tCPL tCPH
Equation Min
2X + 100 2X + 100
32MHz Min
163 163
Max
Max
Unit
ns ns
Low pulse width High pulse width
4.12
General Interrupts (INT0 to INTA)
In the table below, the letter x represents the fsys cycle period Parameter Symbol
tINTAL tINTAH
Equation Min
X + 100 X + 100
32 MHz Min
132 132
Max
Max
Unit
ns ns
Low pulse width for INT0-INTA High pulse width for INT0-INTA
4.13
NMI and STOP/SLEEP Wake-up Interrupts
Parameter Symbol
tINTBL tINTBH
Equation Min
100 100
32 MHz Min
100 100
Max
Max
Unit
ns ns
Low pulse width for NMI and INT0-INT4 High pulse width for INT0-INT4
4.14
SCOUT pin
Parameter Symbol
tSCH tSCL
Equation Min
0.5T - 5 0.5T - 5
32 MHz Min
10.6 10.6
Max
Max
Unit
ns ns
SCOUT high pulse width SCOUT low pulse width
Note: In the above table, the letter T represents the cycle period of the SCOUT output clock.
tSCH SCOUT tSCL
TMP1942CY/CZ-373
TMP1942CY/CZ
4.15
Bus Request and Bus Acknowledge Signals
BUSRQ
(Note1) BUSAK
tBAA tABA AD0~AD15 (Note2)
A0~A23, RD , WR
(Note2)
CS0 ~ CS3 , R / W , HWR
ALE
Parameter
Bus float to BUSAK asserted Bus float after BUSAK negated
Symbol
tABA tBAA
Equation Min
0 0
32 MHz Min
0 0
Max
80 80
Max
80 80
Unit
ns ns
Note 1: If the current bus cycle has not terminated due to wait-state insertion, the TMP1941AF does not respond to BUSRQ until the wait state ends. Note 2: This broken lines indicate that output buffers are disabled, not that the signals are at indeterminate states. The pin holds the last logic value present at that pin before the bus is relinquished. This is dynamically accomplished through external load capacitances. The equipment manufacturer may maintain the bus at a predefined state by means of off-chip resistors, but he or she should design, considering the time (determined by the CR constant) it takes for a signal to reach a desired state. The on-chip, integrated programmable pullup/pulldown resistors remain active, depending on internal signal states.
TMP1942CY/CZ-374
TMP1942CY/CZ
4.16
KWUP
Equation Min
100 100
Pull-up Register Inactive Parameter
Low pulse width for KEY0~D High pulse width for KEY0~D
Symbol
tkyTBL tkyTBH
32 MHz Min
100 100
Max
Max
Unit
ns ns
Static Pull-up Parameter
Low pulse width for KEY0~D
Symbol
tkyTBL
Equation Min
100
32 MHz Min
100
Max
Max
Unit
ns
Dynamic Pull-up Parameter
Low pulse width for KEY0~D
Symbol
tkyTBL
Equation Min
T2+100
32 MHz Min
T2+100
Max
Max
Unit
ns
T2: Dynamic pull-up frequency
4.17
2-phase input pulse counter mode
Parameter Symbol
Tdcyc Tabs Tabh
Equation Min
8Y Y+20 Y+20
32 MHz Min
250 31.27 31.27
Max
Max
Unit
s s s
2-phase input pulse cycle 2-phase input set up 2-phase input hold
Y:Sampling clock(fs or fsys/2)
A Tabs B Tabh Tdcyc
4.18
ADTRG Input
Parameter Symbol
tadL Tadh
Equation Min
fsysy/2+20 fsysy/2+20
32 MHz Min
51.25 51.25
Max
Max
Unit
ns ns
ADTRG low level pulse width ADTRG high level pulse interval
TMP1942CY/CZ-375
TMP1942CY/CZ
5.
I/O Register Summary
The internal I/O registers occupy 8-kbyte addresses from FFFFE000H through FFFFFFFFH.
(1) I/O Ports (2) Watchdog Timer (WDT) (3) Real-Time Clock (RTC) (4) 8-Bit Timer (5) 16-Bit Timer (6) UART/Serial I/O 0/1 (UART/SIO) (7) I2CBUS/Serial I/O (I2C/SIO) (8) UART/Serial I/O 3/4/5 (UART/SIO) (9) 10-Bit A/D Converter (ADC) (10) 10-Bit D/A Converter (DAC) (11) Key On Waik up (KWUP) (12) Interrupt Controller (INTC) (13) DMA Controller (DMAC) (14) Chip Select (CS)/Wait Controller (15) Clock Generator (CG) (16) FLASH (17) ROM correction
Table Organization Mnemonic Register Name Address 7 6 1 0 Bit Symbol Read/Write Reset Value Function
Access R/W : Read/Write. The user can read and write the register bit. R W : Read omly. : Write only.
W* : The user can read and write the register bit, but a read always returns a value of 1.
TMP1942CY/CZ-376
TMP1942CY/CZ
[1] I/O PORT Address
FFFFF000H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
P0 P1 P0CR P1CR P1FC
Address
FFFFF010H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
Address
FFFFF020H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
P4CR P4FC
P2 P2CR P2FC
P3 P3CR P3FC
P4
Address
FFFF040H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
P5 P6 P5FC P6FC
Address
FFFFF050H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH
Mnemonic
PA PB PACR PAFC PBCR PBFC
Address
FFFFF060H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
PE PF PECR PEFC PFCR PFFC PEODE PFODE
PC PD PCCR PCFC PDCR PDFC1 PDFC2 PDODE
P9 P9CR P9FC
CH DH EH FH
Reserved Reserved Reserved Reserved
[2] WDT Address
FFFFF090H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
[3] RTC Mnemonic
WDMOD WDCR
Address
FFFFF0A0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
RTCCR
RTCREG
TMP1942CY/CZ-377
TMP1942CY/CZ
[4] 8 bit Timers Address
FFFFF100H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TA01RUN TA0REG TA1REG TA01MOD TA1FFCR
Address
FFFFF110H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TA45RUN TA4REG TA5REG TA45MOD TA5FFCR
Address
FFFFF120H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TA89RUN TA8REG TA9REG TA89MOD TA9FFCR
TA23RUN TA2REG TA3REG TA23MOD TA3FFCR
TA67RUN TA6REG TA7REG TA67MOD TA7FFCR
TAABRUN TAAREG TABREG TAABMOD TABFFCR
[5] 16 bit Timers Address
FFFFF1 40H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TB0RUN TB0MOD TB0FFCR TB0ST
Address
FFFFF150H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TB1RUN TB1MOD TB1FFCR TB1ST
Address
FFFFF160H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TB2RUN TB2MOD TB2FFCR TB2ST
Address
FFFFF170H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TB3RUN TB3MOD TB3FFCR TB3ST
TB0RG0L TB0RG0H TB0RG1L TB0RG1H TB0CP0L TB0CP0H TB0CP1L TB0CP1H
TB1RG0L TB1RG0H TB1RG1L TB1RG1H TB1CP0L TB1CP0H TB1CP1L TB1CP1H
TB2RG0L TB2RG0H TB2RG1L TB2RG1H TB2CP0L TB2CP0H TB2CP1L TB2CP1H
TB3RG0L TB3RG0H TB3RG1L TB3RG1H TB3CP0L TB3CP0H TB3CP1L TB3CP1H
Address
FFFFF180H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TB4RUN TB4MOD TB4FFCR TB4ST
Address
FFFFF190H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TB5RUN TB5MOD TB5FFCR TB5ST
Address
FFFFF1A0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TB6RUN TB6MOD TB6FFCR TB6ST
Address
FFFFF1B0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TB7RUN TB7MOD TB7FFCR TB7ST
TB4RG0L TB4RG0H TB4RG1L TB4RG1H TB4CP0L TB4CP0H TB4CP1L TB4CP1H
TB5RG0L TB5RG0H TB5RG1L TB5RG1H TB5CP0L TB5CP0H TB5CP1L TB5CP1H
TB6RG0L TB6RG0H TB6RG1L TB6RG1H TB6CP0L TB6CP0H TB6CP1L TB6CP1H
TB7RG0L TB7RG0H TB7RG1L TB7RG1H TB7CP0L TB7CP0H TB7CP1L TB7CP1H
TMP1942CY/CZ-378
TMP1942CY/CZ
Address
FFFFF1C0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TB8RUN TB8MOD Reserved TB8ST
Address
FFFFF1D0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TB9RUN TB9MOD Reserved TB9ST
Address
FFFFF1E0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TBARUN TBAMOD Reserved TBAST
Address
FFFFF1F0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TBBRUN TBBMOD Reserved TBBST
TB8RG0L TB8RG0H TB8RG1L TB8RG1H TB8CP0L TB8CP0H TB8CP1L TB8CP1H
TB9RG0L TB9RG0H TB9RG1L TB9RG1H TB9CP0L TB9CP0H TB9CP1L TB9CP1H
TBARG0L TBARG0H TBARG1L TBARG1H TBACP0L TBACP0H TBACP1L TBACP1H
TBBRG0L TBBRG0H TBBRG1L TBBRG1H TBBCP0L TBBCP0H TBBCP1L TBBCP1H
Address
FFFFF200H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TBCRUN TBCMOD Reserved TBCST
Address
FFFFF210H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TBDRUN TBDMOD Reserved TBDST
TBCRG0L TBCRG0H TBCRG1L TBCRG1H TBCCP0L TBCCP0H TBCCP1L TBCCP1H
TBDRG0L TBDRG0H TBDRG1L TBDRG1H TBDCP0L TBDCP0H TBDCP1L TBDCP1H
[6] UART/SIO 0/1 Address
FFFFF230H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
[7] I2CBUS/SIO Address
FFFFF240H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
[8] UART/SIO 3/4 Address
FFFFF280H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
UART/SIO 5 Address
FFFFF290H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
SC0BUF SC0CR SC0MOD0 BR0CR BR0ADD SC0MOD1 SC0MOD2 SC1BUF SC1CR SC1MOD0 BR1CR BR1ADD SC1MOD1 SC1MOD2
Mnemonic
SBI0CR1 SBI0DBR I2C0AR SBI0CR2/SR SBI0BR0 (SBI0BR1)
Mnemonic
SC3BUF SC3CR SC3MOD0 BR3CR BR3ADD SC3MOD1 SC3MOD2 SC4BUF SC4CR SC4MOD0 BR4CR BR4ADD SC4MOD1 SC4MOD2
Mnemonic
SC5BUF SC5CR SC5MOD0 BR5CR BR5ADD SC5MOD1 SC5MOD2
TMP1942CY/CZ-379
TMP1942CY/CZ
[9] 10 bitADC Address
FFFFF300H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
ADREG08L ADREG08H ADREG19L ADREG19H ADREG2AL ADREG2AH ADREG3BL ADREG3BH ADREG4CL ADREG4CH ADREG5DL ADREG5DH ADREG6EL ADREG6EH ADREG7FL ADREG7FH
Address
FFFFF310H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
ADREGSPL ADREGSPH
ADCOML ADCOMH
ADMOD0 ADMOD1 ADMOD2 ADMOD3 ADMOD4
ADCLK
[10] 10BIT DAC Address
FFFFF340H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
DAREG0L DAREG0H DACCNT0 DAREG1L DAREG1H DACCNT1 DAREG2L DAREG2H DACCNT2
[11] KWUP Address
FFFFF360H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
[12] INTBCDE Mnemonic
KWUPST0 KWUPST1 KWUPST2 KWUPST3 KWUPST4 KWUPST5 KWUPST6 KWUPST7 KWUPST8 KWUPST9 KWUPSTA KWUPSTB KWUPSTC KWUPSTD
Address
FFFFF370H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
KWUPCLR KWUPCNT Reserved
Address
FFFFF 380H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
INTBST INTCST INTDST INTEST INTFLG
Address
Mnemonic
TMP1942CY/CZ-380
TMP1942CY/CZ
[13] INTC Address
FFFFE000H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
IMC0
Address
FFFFE010H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
IMC4
Address
FFFFE020H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
IMC8
Address
FFFFE030H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
IMCC
IMC1
IMC5
IMC9
IMCD
IMC2
IMC6
IMCA
IMCE
IMC3
IMC7
IMCB
IMCF
Address
FFFFE040H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
IVR IVR
Address
FFFFE050H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
Address
FFFFE060H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
INTCLR
Address
FFFFE070H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
TMP1942CY/CZ-381
TMP1942CY/CZ
[14] DAMC Address
FFFFE200H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH SAR0
Mnemonic
CCR0
Address
FFFFE210H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
BCR0
Address
FFFFE220H 1H 2H 3H 4H 5H 6H 7H
Mnemonic
CCR1
Address
FFFFE230H 1H 2H 3H 4H 5H 6H 7H
Mnemonic
BCR1
CSR0
CSR1
NCR1
DTCR0
8H 9H AH BH CH DH EH FH
SAR1
8H 9H AH BH CH DH EH FH
DTCR1
DAR0
DAR1
Address
FFFFE240H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
CCR2
Address
FFFFE250H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
BCR2
Address
FFFFE260H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
CCR3
Address
FFFFE270H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
BCR3
CSR2
NCR2
CSR3
NCR3
SAR2
DTCR2
SAR3
DTCR3
DAR2
DAR3
Address
FFFFE280H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
DCR
Address
FFFFE290H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH
Mnemonic
Address
FFFFE2A0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
Address
FFFFE2B0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
DHR
CH DH EH FH
TMP1942CY/CZ-382
TMP1942CY/CZ
[15] CS/WAIT Controller Address
FFFFE400H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
BMA0
Address
FFFFE410H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
Address
FFFFE480H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
B01CS
Address
FFFFE490H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
BMA1
B23CS
BMA2
BEXCS
BMA3
[16] CG Address
FFFFEE00H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
SYSCR0 SYSCR1 SYSCR2 SYSCR3 ADCCK
Address
FFFFEE10H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
IMCGA0
Address
FFFFEE20H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
EICRCG Reserved Reserved Reserved
Address
FFFFEE40H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved
IMCGB0
Reserved Reserved Reserved Reserved
[17] FLASH(FLASH only./Access to FLASH is not possible with DMA.) Address
FFFFE510H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
SEQMOD
Address
FFFFE520H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
FLCS
SEQCNT
TMP1942CY/CZ-383
TMP1942CY/CZ
[18] ROM correction(Access to FLASH is not possible with DMA.) Address
FFFFE540H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Mnemonic
ADDREG0
ADDREG1
ADDREG2
ADDREG3
TMP1942CY/CZ-384
TMP1942CY/CZ
6. JTAG Interface
The TMP1942FDXB/CYXB processor provides a boundary-scan interface that is compatible with Joint Test Action Group (JTAG) specifications, using the industry-standard JTAG protocol (IEEE Standard 1149.1/D6). This chapter describes that interface, including descriptions of boundary scanning, the pins and signals used by the interface, and the Test Access Port (TAP).
6.1 What Boundary Scanning Is
With the evolution of ever-denser integrated circuits (ICs), surface-mounted devices, double-sided component mounting on printed-circuit boards (PCBs), and buried vias, in-circuit tests that depend upon making physical contact with internal board and chip connections have become more and more difficult to use. The greater complexity of ICs has also meant that tests to fully exercise these chips have become much larger and more difficult to write. One solution to this difficulty has been the development of boundary-scan circuits. A boundary-scan circuit is a series of shift register cells placed between each pin and the internal circuitry of the IC to which the pin is connected, as shown in Figure 6.1.1. Normally, these boundary-scan cells are bypassed; when the IC enters test mode, however, the scan cells can be directed by the test program to pass data along the shift register path and perform various diagnostic tests. To accomplish this, the tests use the four signals described in the next section: TDI, TDO, TMS, TCK, and TRST .
Integrated Circuit
IC package pin Boundary-scan cells
Figure 6.1.1 JTAG Boundary-scan Cells
TMP1942CY/CZ-385
TMP1942CY/CZ
6.2 Signal Summary
The JTAG interface signals are listed below and shown in Figure 6.2.1. * * * * * TDI TDO TMS TCK
TRST
JTAG serial data in JTAG serial data out JTAG test mode select JTAG serial clock input JTAG test reset input
3 Instruction register
0
JTDI pin
0 JTD0 pin TAP Controller Bypass register
JTMS pin 114 Boundary-scan register 0 JTCK pin
TRST
pin
Figure 6.2.1 JTAG Interface Signals and Registers The JTAG boundary-scan mechanism (referred to in this chapter as JTAG mechanism) allows testing of the connections between the processor, the printed circuit board to which it is attached, and the other components on the circuit board. The JTAG mechanism does not provide any capability for testing the processor itself.
TMP1942CY/CZ-386
TMP1942CY/CZ
6.3 JTAG Controller and Registers
The processor contains the following JTAG controller and registers: * * * * * Instruction register Boundary-scan register Bypass register ID Code register Test Access Port (TAP) controller
The processor executes the standard JTAG EXTEST operation associated with External Test functionality testing. The basic operation of JTAG is for the TAP controller state machine to monitor the JTMS input signal. When it occurs, the TAP controller determines the test functionality to be implemented. This includes either loading the JTAG instruction register (IR), or beginning a serial data scan through a data register (DR), listed in Table 6.3.1. As the data is scanned in, the state of the JTMS pin signals each new data word, and indicates the end of the data stream. The data register to be selected is determined by the contents of the Instruction register.
6.3.1
Instruction Register
The JTAG Instruction register includes eight shift register-based cells; this register is used to select the test to be performed and/or the test data register to be accessed. As listed in Table 6.3.1, this encoding selects either the Boundary-scan register or the Bypass register or Device Identification register. Table 6.3.1 JTAG Instruction Register Bit Encoding Instruction Code (MSB LSB)
0000 0001 0010 to 1110 1111
Instruction
EXTEST SAMPLE/PRELOAD Reserved BYPASS
Selected Data Register
Boundary Scan Register Boundary Scan Register Reserved Bypass register
Figure 66.3.1 shows the format of the Instruction register
3 MSB 2 1 0 LSB
Figure 66.3.1 Instruction Register The instruction code is shifted out to the Instruction register from the LSB.
MSB TDI LSB TDO
Figure 6.3.2 Instruction Register Shift Direction
TMP1942CY/CZ-387
TMP1942CY/CZ
6.3.2
Bypass Register
The Bypass register is 1 bit wide. When the TAP controller is in the Shift-DR (Bypass) state, the data on the TDI pin is shifted into the Bypass register, and the Bypass register output shifts to the TDO output pin. In essence, the Bypass register is a short-circuit which allows bypassing of board-level devices, in the serial boundary-scan chain, which are not required for a specific test. The logical location of the Bypass register in the boundary-scan chain is shown in Figure6.3.3. Use of the Bypass register speeds up access to boundary-scan registers in those ICs that remain active in the board-level test datapath.
JTDI Bypass register
Board input JTDO Board output JTDI JTDI JTDO
JTDO
JTDO JTDI JTDO
JTDI
Boundary-scan register pad cell
IC package
Board
Figure 6.3.3 Bypass Register Operation
6.3.3
Boundary-Scan Register
The Boundary Scan register includes all of the inputs and outputs of the TMP1942 processor, except some analog output and control signals. The pins of the TMP1942 chip can be configured to drive any arbitrary pattern by scanning into the Boundary Scan register from the Shift-DR state. Incoming data to the processor is examined by shifting while in the Capture-DR state with the Boundary Scan register enabled. The Boundary-scan register is a single, 115-bit-wide, shift register-based path containing cells connected to all input and output pads on the TMP1942 processor. The TDI input is loaded to the LSB of the Boundary Scan register. The MSB of the Boundary Scan register is retrieved from the JTDO output.
TMP1942CY/CZ-388
TMP1942CY/CZ
6.3.4
Test Access Port (TAP)
The Test Access Port (TAP) consists of the five signal pins: TRST , TDI, TDO, TMS, and TCK. Serial test data and instructions are communicated over these five signal pins, along with control of the test to be executed. As Figure shows, data is serially scanned into one of the three registers (Instruction register, Bypass register, or the Boundary-scan register) from the TDI pin, or it is scanned from one of these three registers onto the TDO pin. The TMS input controls the state transitions of the main TAP controller state machine. The TCK input is a dedicated test clock that allows serial JTAG data to be shifted synchronously, independent of any chip-specific or system clocks.
TCK TMS and TDI sampled on rising edge of TCK Data scanned in serially 3 Instruction register 0 3 Instruction register TDO sampled on falling edge of TCK Data scanned out serially 0
0 Bypass register TDI pin
0 Bypass register TDO pin
115
0
TMS pin
115
0
Boundary-scan registe
Boundary-scan register
Figure 6.3.4 JTAG Test Access Port Data on the TDI and TMS pins is sampled on the rising edge of the TCK input clock signal. Data on the TDO pin changes on the falling edge of the TCK clock signal.
6.3.5
TAP Controller
The processor implements the 16-state TAP controller as defined in the IEEE JTAC specification.
6.3.6
Controller Reset
The TAP controller state machine can be put into Reset state the following: * * assertion of the TRST signal (Low) resets the TAP controller. keeping the TMS input signal asserted through five consecutive rising edges of TCK input.
In either case, keeping TMS asserted maintains the Reset state.
TMP1942CY/CZ-389
TMP1942CY/CZ
6.3.7
TAP Controller
The state transition diagram of the TAP controller is shown in Figure6.3.5. Each arrow between states is labeled with a 1 or 0, indicating the logic value of TMS that must be set up before the rising edge of TCK to cause the transition.
1 Test-Logic-Reset 0 0 Run-Test/Idle 1 Select-DR-Scan 1 Select-IR-Scan 1
0 Capture-DR
0 Capture-IR
1
1
0 Shift-DR 0
0 Shift-IR 0
1 Exit 1-DR 1
1 Exit 1-IR 1
0 Pause-DR 0
0 Pause-IR 0
1 0 Exit 2-DR 0
1 Exit 2-IR
1 Update-DR
1 Update-IR
1
0
1
0
Figure 6.3.5 TAP Controller State Diagram The following paragraphs describe each of the controller states. The left vertical column in Figure6.3.5 is the data column, and the right vertical column is the instruction column. The data column and instruction column reference data register (DR) and instruction register (IR), respectively.
TMP1942CY/CZ-390
TMP1942CY/CZ
* Test-Logic-Reset When the TAP controller is in the Reset state, the Device Identification register is selected as default. The three most significant bits of the Boundary-scan register are cleared to 0, disabling the outputs. The controller remains in this state while TMS is high. If TMS is held low while the controller is in this state, then the controller moves to the Run-Test/Idle state. * Run-Test/Idle In the Run-Test/Idle state, the IC is put in a test mode only when certain instructions such as a built-in self test (BIST) instruction are present. For instructions that do not cause any activities in this state, all test data registers selected by the current instruction retain their previous states. The controller remains in this state while TMS is held low. When TMS is high, the controller moves to the Select-DR-Scan state. * Select-DR-Scan This is a temporary controller state. Here, the IC does not execute any specific functions. If TMS is held low when the controller is in this state, then the controller moves to the Capture-DR state. If TMS is held high, the controller moves to the Select-IR-Scan state in the instruction column. * Select-IR-Scan This is a temporary controller state. Here, the IC does not execute any specific functions. If TMS is held low when the controller is in this state, then the controller moves to the Capture-IR state. If TMS is held high, the controller returns to the Test-Logic-Reset state. * Capture-DR In this controller state, if the test data register selected by the current instruction on the rising edge of TCK has parallel inputs, then data can be parallel-loaded into the shift portion of the data register. If the test data register does not have parallel inputs, or if data need not be loaded into the selected data register, then the data register retains its previous state. If TMS is held low while the controller is in this state, the controller moves to the Shift-DR state. If TMS is held high, the controller moves to the Exit1-DR state. * Shift-DR In this controller state, the test data register connected between TDI and TDO shifts data one stage forward towards its serial output. When the controller is in this state, then it remains in the Shift-DR state if TMS is held low, or moves to the Exit1-DR state if TMS is held high.
TMP1942CY/CZ-391
TMP1942CY/CZ
* Exit 1-DR This is a temporary controller state. If TMS is held low when the controller is in this state, the controller moves to the Pause-DR state. If TMS is held high, the controller moves to the Update-DR state. * Pause-DR This state allows the shifting of the data register selected by the instruction register to be temporarily suspended. Both the instruction register and the data register retain their current states. When the controller is in this state, then it remains in the Pause-DR state if TMS is held low, or moves to the Exit2-DR state if TMS is held high. * Exit 2-DR This is a temporary controller state. When the controller is in this state, then it returns to the Shift-DR state if TMS is held low, or moves on to the Update-DR state if TMS is held high. * Update-DR In this state, data is latched, on the falling edge of TCK, onto the parallel outputs of the data registers from the shift register path. The data held at the parallel output does not change while data is shifted in the associated shift register path. When the controller is in this state, it moves to either the Run-Test/Idle state if TMS is held low, or the Select-DR-Scan state if TMS is held high. * Capture-IR In this state, data is parallel-loaded into the instruction register. The two least significant bits are assigned the values "01". The higher-order bits of the instruction register can receive any design specific values. The Capture-IR state is used for testing the instruction register. Faults in the instruction register, if any exist, may be detected by shifting out the data loaded in it. When the controller is in this state, it moves to either the Shift-IR state if TMS is low, or the Exit1-IR state if TMS is high. * Shift-IR In this state, the instruction register is connected between TDI and TDO and shifts the captured data toward its serial output on the rising edge of TCK. When the controller is in this state, it remains in the Shift-IR state if TMS is low, or moves to the Exit1-IR state if TMS is high.
TMP1942CY/CZ-392
TMP1942CY/CZ
* Exit 1-IR This is a temporary controller state. When the controller is in this state, it moves to either the Pause-IR state if TMS is held low, or the Update-IR state if TMS is held high. * Pause-IR This state allows the shifting of the instruction register to be temporarily suspended. Both the instruction register and the data register retain their current states. When the controller is in this state, it remains in the Pause-IR state if TMS is held low, or moves to the Exit2-IR state if TMS is held high. * Exit 2-IR This is a temporary controller state. When the controller is in this state, it moves to either the Shift-IR state if TMS is held low, or the Update-IR state if TMS is held high. * Update-IR This state allows the instruction previously shifted into the instruction register to be output in parallel on the rising edge of TCK. Then it becomes the current instruction, setting a new operational mode. When the controller is in this state, it moves to either the Run-Test/Idle state if TMS is low, or the Select-DR-Scan state if TMS is high.
Table 6.3.2 shows the boundary scan order of the processor signals. Table 6.3.2 TMP1942 JTAG Boundary-Scan Ordering
[TDI] 7: P56 14: P65 21: P04 28: P13 35: P22 42: BW1 49: P36 56: P90 63: P97 70: PA6 77:PC4 84: PF3 91:PD7 98:PB4 105:PD3 112:PE4 1:P50 8: P57 15: P66 22: P05 29: P14 36: P23 43: P30 50: P37 57: P91 64: PA0 71: PA7 78:PC5 85: PF4 92:NMI 99:PB5 106:PD4 113:PE5 2: P51 9: P60 16: P67 23:P06 30: P15 37: P24 44: P31 51:P40 58: P92 65: PA1 72:RSTPUP 79: PC6 86: PF5 93:BW0 100:PB6 107:PD5 114:PE6 3:P52 10: P61 17: P00 24: P07 31: P16 38: P25 45: P32 52:P41 59: P93 66: PA2 73: PC0 80:PC7 87: PF6 94:PB0 101:PB7 108:PE0 115:PE7 4: P53 11: 62 18:P01 25: P10 32: P17 39: P26 46: P33 53:P42 60: P94 67: PA3 74: PC1 81:PF0 88:TEST1 95:PB1 102:PD0 109:PE1 [TDO]: 5:P54 12: P63 19: P02 26: P11 33: P20 40:P27 47: P34 54:P43 61: P95 68: PA4 75: PC2 82: PF1 89:RESET 96:PB2 103:PD1 110:PE2 6:P55 13: P64 20: P03 27: P12 34: P21 41: ALE 48: P35 55:P44 62: P96 69: PA5 76:PC3 83: PF2 90:PD6 97:PB3 104:PD2 111:PE3
TMP1942CY/CZ-393
TMP1942CY/CZ
6.4 Instructions for JTAG
This section defines the instructions supplied and the operations that occur in response to those instructions.
6.4.1
The EXTEST Instruction
This instruction is used for external interconnect test, and targets the boundary scan register between TDI and TDO. The EXTEST instruction permits BSR cells at output pins to shift out test patterns in the Update-DR state and those at input pins to capture test results in the Capture-DR state. Typically, before EXTEST is executed, the initialization pattern is first shifted into the boundary scan register using the SAMPLE/PRELOAD instruction. In the Update-DR state, the boundary scan register loaded with the initialization pattern causes known data to be driven immediately from the IC onto its external interconnects. This eliminates the possibility of bus conflicts damaging the IC outputs. The flow of data through the boundary scan register while the EXTEST instruction is selected is shown in Figure 6.4.1, which follows:
Boundary Scan Path
INPUT
Core Logic
OUTPUT
TDI
TDO
Figure 6.4.1 Test Data Flow While the EXTEST Instruction is Selected The following steps describe the basic test algorithm of an external interconnect test. 1. Initialize the TAP controller to the Test-Logic-Reset state. 2. Load the instruction register with SAMPLE/PRELOAD. This causes the boundary scan register to be connected between TDI and TDO. 3. Initialize the boundary scan register by shifting in determinate data. 4. Then, load the initial test data into the boundary scan register. 5. Load the instruction register with EXTEST. 6. Capture the data applied to the input pin into the boundary scan register. 7. Shift out the captured data while simultaneously shifting in the next test pattern. 8. Read out the data in the boundary scan register onto the output pin. Steps 6 to 8 are repeated for each test pattern.
TMP1942CY/CZ-394
TMP1942CY/CZ
6.4.2
The SAMPLE/PRELOAD Instruction
This instruction targets the boundary scan register between TDI and TDO. As the instruction's name implies, two functions are performed through use of the SAMPLE/ PRELOAD instruction. * SAMPLE allows the input and output pads of an IC to be monitored. While it does so, it does not disconnect the system logic from the IC pins. The SAMPLE function occurs in the Capture-DR controller state. An example application of SAMPLE is to take a snapshot of the activity of the IC's I/O pins so as to verify the interaction between ICs during normal functional operation. The flow of data for the SAMPLE phase of the SAMPLE/PRELOAD instruction is shown in Figure 6.4.2.
Boundary Scan Path
INPUT
Core Logic
OUTPUT
TDI
TDO
Figure 6.4.2 Test Data Flow While SAMPLE is Selected * PRELOAD allows the boundary scan register to be initialized before another instruction is selected. For example, prior to selection of the EXTEST instruction, initialization data is shifted into the boundary scan register using PRELOAD as described in the previous subsection. PRELOAD permits shifting of the boundary scan register without interfering with the normal operation of the system logic. The flow of data for the PRELOAD phase of the SAMPLE/PRELOAD instruction is shown in Figure 6.4.3.
Boundary Scan Path
INPUT
Core Logic
OUTPUT
TDI
TDO
Figure 6.4.3 Test Data Flow While PRELOAD is Selected
6.4.3
The BYPASS Instruction
This instruction targets the bypass register between JTDI and JTDO. The bypass register provides a minimum length serial path through the IC (or between JTDI and JTDO) when the IC is not required for the current test. The BYPASS instruction does not cause interference to the normal operation of the on-chip system logic. The flow of data through the bypass register while the BYPASS instruction is selected is shown in Figure 6.4.4.
Bypass Register TDI 1-bit TDO
Figure 6.4.4 Test Data Flow While the Bypass Instruction is Selected
TMP1942CY/CZ-395
TMP1942CY/CZ
6.5 Note
This section describes details of JTAG boundary-scan operation that are specific to the processor. * * The DAOUT0, 1, 2, X2, and X1 signal pads do not support JTAG. Reset for JTAG
(1) JTAG circuit is initialized by TRST assertion. And then deassert TRST . (2) At input to TMS = 1 and asserted for more 5 TCK cycles.
TMP1942CY/CZ-396
TMP1942CY/CZ
7 I/O Port Equivalent-Circuit Diagrams
* How to read circuit diagrams The circuit diagrams in this chapter are drawn using the same gate symbols as for the 74HCxx Series standard CMOS logic ICs. The signal named STOP has a unique function. This signal goes active-high if the CPU sets the HALT bit when the STBY[1:0] field in the SYSCR2 register is programmed to 01 (i.e., STOP mode) and the Drive Enable (FRVE) bit in the same register is cleared. If the DRVE bit is set, the STOP signal remains inactive (at logic 0). * The input protection circuit has a resistor in the range of several tens to several hundreds of ohms. P0(D0 to D7 / AD0 to AD7), P1(D8 to D15 / AD8 to AD15, A8 to A15), P2(A16 to A23, A0 to A7), P92 to P97, PA0 to PA6, PB0 to PB6, PC0 to PC5, PC7, PD0, PD1, PD4, PE1, PE4, PE6, PE7, PF3, PF6
VCC Output Data Output Enable STOP Input Data P-ch N-ch Input/Output
Input Enable
P30( RD ), P31( WR ), DCLK, PCST3 to PCST0, SDAO / TPC, TDO
Vcc Output Data Output STOP
P32 to P36, P40 to P43
Vcc Output Data P-ch Vcc Output Enable STOP Input data N-ch Programmable Pull-up Resistor Input/Output
Input Enable
TMP1942CY/CZ-397
TMP1942CY/CZ
P5 (AN0 to AN7)
Analog Input Channel Select Analog Input Input
Input Data
Input Enable
P6 (AN8 to AN15)
Vcc Programmable Pull-up Resistor
Analog Input Channel Select Analog Input Pull-up Control Input Data
Input
Input Enable
PD2, PD3, PD5, PE0, PE2, PE3, PE5, PF0, PF2, PF4, PF5
Vcc Output Data Open-Drain Output Enable Output Enable STOP Input Data Input Enable Input/Output P-ch
N-ch
P90, P91, PA7, PB7, PC6, PF1
Vcc Output Data P-ch Vcc Programmable Pull-up Resistor Input/Output
Output Enable STOP Pull-up Control Input Data
N-ch
Input Enable
TMP1942CY/CZ-398
TMP1942CY/CZ
PD6 (XT1), PD7 (XT2)
Clock Input Enable Input Data Output Data Output Enable Input Enable Input Data Output Data Output Enable STOP Low-Frequency Oscillator Enable PD6(XT1) Oscillator Circuit PD7(XT2)
NMI , BW0 to BW1, PLLOFF , RSTPUP
NMI PLLOFF
Input Schmitt-Trigger
RESET
Vcc
Reset Schmitt-Trigger WDTOUT Reset Enable
Input
DRESET, DBGE, SDI/DINT, TCK, TMS, TDI
Vcc
Debag Reset Schmitt-Trigger
Input
TRST
Test Reset Schmitt-Trigger
Input
TMP1942CY/CZ-399
TMP1942CY/CZ
X1, X2
Oscillator Circuit X2 High-Frequency Oscillator Enable X1
Clock
VREFH, VREFL
VREFON
P-ch VREFH
Ladder Resistor
VREFL
TMP1942CY/CZ-400
TMP1942CY/CZ
8.
Notations, Precautions and Restrictions
8.1 Notations and Terms
(1) I/O register fields are often referred to as . for the interest of brevity. For example, TRUN.T0RUN means the T0RUN bit in the TRUN register. (2) fc, fs, fsys, state fosc: fpll: fc: fs: fsys: Clock supplied from the X1 and X2 pins Clock generated by the on-chip PLL Clock selected by the PLLOFF pin Clock supplied from the XT1 and XT2 pins Clock selected by the SYSCR1.SYSCK bit
fgear: Clock selected by the SYSCR1.GEAR[1:0] bits The fsys cycle is referred to as a state. In addition, the clock selected by the SYSCR1.FPSEL bit and the prescaler clock source selected by the SYSCR0.PRCK[1:0] bits are referred to as fperiph and T0 respectively.
8.2 Precautions and Restrictions
(1) Processor Revision Identifier The Process Revision Identifier (PRId) register in the TX19 core of the TMP1942 contains 0x0000_2C91. (2) BW0 to BW1 Pins The BW0 and BW1 pins must be connected to the DVCC pin to ensure that their signal levels do not fluctuate during chip operation. (3) Oscillator Warm-Up Counter If an external crystal is utilized, an interrupt signal programmed to bring the TMP1942 out of STOP mode triggers the on-chip warm-up counter. The system clock is not supplied to the on-chip logic until the warm-up counter expires. (4) Programmable Pull-up Resistors When port pins are configured as input ports, the integrated pull-up resistors can be enabled and disabled under software control. The pull-up resistors are not programmable when port pins are configured as output ports. The relevant port registers are programmed with the data resistor. (5) External Bus Mastership The pin states while the bus is granted to an external device are described in Chapter 7, I/O Ports. (6) Watchdog Timer (WDT) Upon reset, the WDT is enabled. If the watchdog timer function is not required, it must be disabled after reset. When relevant pins are configured as bus arbitration signals, the I/O peripherals including the WDT can operate during external bus mastership. (7) A/D Converter (ADC) The ladder resistor network between the VREFH and VREFL pins can be disconnected under software control. This helps to reduce power dissipation, for example, in STOP mode.
TMP1942CY/CZ-401
TMP1942CY/CZ
(8) Undefined Bits in I/O Registers Undefined I/O register bits are read as undefined states. Therefore, software must be coded without relying on the states of any undefined bits. (9) Notations, Precautions and Restrictions Overflow Exception #1 Problem: When an overflow exception is taken, the EPC register might contain an incorrect return address, pointing to the instruction immediately following the one that caused an overflow. The restart location in the EPC register should be the address of the arithmetic instruction that caused the exception, rather than the following instruction.
Detects an overflow and writes to EPC.
n
Arithmetic Instruction (e.g., ADD)
F
D
E
M
W
n+4
Next Instruction
F
D
E
M
W
Instruction Pipeline
Detects an interrupt. Writes to EPC.
EPC Register
n
n+4
In the above example, the processor writes address n to the EPC register upon detection of an overflow. However, executing the next instruction generates an interrupt at the same time, causing the processor to rewrite the EPC register with address n+4 in the next cycle. * Problem-Causing Situation: A) Software uses the ADD, ADDI or SUB instruction in the 32-bit ISA. B) The ADD, ADDI or SUB instruction causes an overflow. C) Another exception is requested simultaneously with the overflow. This problem occurs when all of these conditions are true.
Workarounds: * Before returning from the overflow exception handler, determine whether the instruction pointed to by the EPC register caused an overflow. * * Make sure that two arithmetic instructions will not appear consecutively. Disable interrupts prior to arithmetic instructions. You should always use one of these workarounds to avoid this problem. Note: Toshiba's compiler uses no instructions that could cause an overflow. Therefore, since condition c) above never becomes true, this problem does not occur.
TMP1942CY/CZ-402
TMP1942CY/CZ
Overflow Exception #2 Problem: If an overflow exception caused a jump to the exception handler and the first instruction in that exception handler caused another exception, the EPC register should point to the address of the first instruction in the exception handler. However, the EPC register might contain the address that caused the overflow exception. * Problem-Causing Situation: When, with the instruction pipeline full, an overflow exception was taken at the following sequence of instructions and then the first instruction in the overflow exception handler causes another exception ADD, ADDI or SUB Delay slot Note: Toshiba's compiler uses no instructions that could cause an overflow. Therefore, this problem does not occur. <= # Instruction that causes an overflow Jump or branch instruction <= # Instruction with a delay slot
Workaround: Don't place a jump or branch instruction immediately following an instruction that could cause an overflow (ADD, ADDI or SUB).
TMP1942CY/CZ-403
TMP1942CY/CZ
LWL and LWR Instructions Problem: The LWL or LWR instruction might provide incorrect results. * Problem-Causing Situation #1: a. The destination of a load instruction (LB, LBU, LH, LHU, LW, LWL or LWR) is identical to that of the LWL or LWR instruction. b. The instruction pipeline is full. (The load instruction and the LWL or LWR instruction will be executed consecutively.) c. The DMAC is programmed for data cache snooping. Once the load instruction is executed, the DMAC initiates a DMA transaction. After it has been serviced, the LWLor LWR instruction is executed. This problem occurs when all of these conditions are true. * Problem-Causing Situation #2: a. The destination of a load instruction (LB, LBU, LH, LHU, LW, LWL or LWR) is identical to that of the LWL or LWR instruction. b. The Doze or Halt bit in the Config register is set to 1 immediately before the load instruction. c. The instruction pipeline is full. (The load instruction and the LWL or LWR instruction will be executed consecutively.) d. After the load instruction is executed, the processor is put in the STOP, SLEEP or IDLE mode. e. After an interrupt signaling brings the processor out of the STOP, SLEEP or IDLE mode, the LWL or LWR instruction is executed. Note: This applies to the case in which an interrupt signaling does not generate an interrupt upon exit from STOP, SLEEP or IDLE mode. In other words, either the IEc bit in the Status register is cleared (interrupts disabled), or if the IEc bit is set, the priority level of the incoming interrupt signaling is lower than the mask level programmed in the CMask field in the Status register. (Exit from STOP, SLEEP or IDLE mode can be accomplished even with such settings.)
This problem occurs when all of these conditions are true.
Workarounds: To use the LWL or LWR instruction, 1) Place a NOP between a load instruction and the LWL or LWR instruction, or 2) Disable the data cache snooping of the DMAC before the LWL or LWR instruction is executed. Also, don't put the processor in STOP, SLEEP or IDLE mode before the LWL or LWR instruction is executed.
TMP1942CY/CZ-404
TMP1942CY/CZ
Overflow Exception When a DSU Probe Is Used Problem: It looks as if an overflow exception caused a jump to the reset and nonmaskable exception vector address (0xBFC0_0000). * Problem-Causing Situation: When an overflow exception occurs, with the processor connected to a DSU probe Note: Toshiba's compiler uses no instructions that could cause an overflow. Therefore, this problem does not occur.
Workaround: Don't place a jump or branch instruction immediately following an instruction that could cause an overflow (ADD, ADDI or SUB).
IDLE (Doze) Mode Problem: A deadlock might occur when returning to normal operating mode from IDLE (Doze) mode. * Problem-Causing Situation: When the DMAC initiates a DMA transaction with snooping enabled after the Doze bit in the Config register is set and before the CPU clock stops.
Workaround: If snooping is enabled, stop the DMAC before putting the processor in IDLE (Doze) mode.
TMP1942CY/CZ-405


▲Up To Search▲   

 
Price & Availability of TMP1942XBG

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X